How To Use Apple’s Developer Documentation for Fun and Profit
Did you know Apple has a ton of helpful articles, documentation and resources for app developers? And it’s not just only about Swift – they have guides about app marketing, design and business.
You might already know some docs, like the official Apple Developer Documentation about Swift, iOS SDKs and Xcode. Other documentation is a bit more hidden, like Apple’s own iOS app design templates and device mockups.
In this tutorial I’ll guide you through using these resources effectively. I’ll show you where to find them, how to read them, and how you can apply the information in your own app development projects.
Table of Contents
The Apple Developer Documentation
The Apple Developer Documentation is by far the most comprehensive and extensive resource about iOS development. It has thousands of pages that explain the different frameworks, components, classes and functions of the iOS SDKs.
It includes documentation for Foundation, the fundamental framework that underlies macOS, tvOS, watchOS and iOS apps, and the Swift Standard Library. It also features documentation for every public Apple framework – often denoted as “-kit” – such as ARKit, GameKit and MapKit.
You’ll find both overviews, that explain topics and concepts, and API references, that show you how classes and functions of these SDKs work. Most of them also include sample code and example projects.
You can reach most documentation via developer.apple.com, and you won’t need a Developer Account to access them.
What’s the difference between an API and an SDK? An API is the code you talk to, so functions and properties. An SDK is the “package” that code is housed in. You can compare an SDK with a car engine, and an API with the steering wheel and gas pedal.
Let’s take a look at the docs for UIKit. UIKit is the framework you use to build graphical user interfaces (GUIs) for iOS apps. When we take a look at its overview page, we learn that UIKit “provides the window and view architecture for your UIs, event handling for Multitouch, and the main run loop needed to manage interactions among the user, the system, and your app.”
On the page we see a bunch of helpful stuff:
- At the top of the page, Framework tells us that this page is about a framework called UIKit. On other pages, you’ll see types like ”Article”, ”Class” or ”Generic struct”. That information helps you to identify what exactly you’re looking at.
- On the right, we see a list of SDKs that UIKit supports. So now we know that we can use UIKit on iOS, tvOS and watchOS, and what versions. That “2.0+” means: version 2.0 of iOS and higher.
- Below the main text we see a callout text box that gives important information about UIKit. When you see those boxes, don’t skip them! In this case, the docs inform us that we should always use UIKit on the main thread.
When we go deeper, we can get to a page like Views and Controls. Articles like these make the Apple Developer Documentation so helpful. Instead of just listing classes and functions, it has visual explanations on components like views.
When you’re just starting out with iOS development, simple explanations like the ones below can make a big difference.
The major iOS frameworks like UIKit are surprisingly consistent. See those views in the above screenshot? Their class names are UILabel, UIDatePicker and UISwitch. The “UI” part is a prefix, and it comes from “UIKit”. Likewise, you’ll find an SKProduct class in StoreKit (“SK”) and a CGColor in Core Graphics (“CK”).
Fun fact: The “NS” prefix used for Objective-C classes comes from “NeXTSTEP”, the software built by NeXT, the company Steve Jobs founded after being fired by Apple in 1985. NeXTSTEP found its way into iOS after Apple acquired NeXT, a step that also lead to the return of Jobs to Apple.
Finally, when we continue to the View Controllers page, we can read up on literally every kind of view controller that’s part of UIKit. Table view controllers, collection view controllers, navigation controllers, tab bar controllers – it’s all there.
If you’re coding iOS apps, and you’ve never read this page… READ IT NOW! There’s a lot of good stuff in there, and its fundamental knowledge you need to have.
The Swift Language Guide is also part of the Apple Developer Documentation. It’s super helpful for understanding Swift features and syntax, although it can be a bit overwhelming for beginners.
Developer Docs on Classes and Functions
If you’re a bit like me, you also use Google to find the most basic things about iOS development. Whenever you Google a Swift class name, like SKProduct or UISwitch you’ll often find an Apple Developer Documentation page as the first search result.
Again, the documentation is very helpful in explaining what a UILabel exactly is.
- At the top of the page we see a breadcrumb that tells us where we are in the documentation. It gives some structural information, like “A UILabel is part of UIKit” and “It’s a view.”
- At the top of the page we also see that this UILabel component is, in fact, a class. That gives us information on how to use it in our own code.
- At the right of the page, we see what platforms a UILabel is part of. This section also provides on-page navigation.
When we scroll down or use the on-page navigation, we can read a whole lot about the use of labels. What properties and attributes does it have? How do you change its text color? How can we internationalise its text?
We ultimately end up at a list of functions, properties and relationships. Like this one:
At this part of the page we read that text is the property I can use to change the text on a label, font for its font, and textColor for the text color. These are obvious of course, but it’s still faster to look them up in the documentation than it is to Google for “how to change label text color.”
Again, there’s a lot of helpful information here:
- At the left, we see that properties and functions have been categorised. When you’re looking for a particular property or function, these categories can help you locate them.
- In the list, properties and functions are written with the right Swift syntax. You can see their names, types, parameters and description. You can also click on them – more about that later.
- At the top of the page you can switch between Swift and Objective-C. Try it! When you switch to Objective-C, the definitions on the page change.
These detail pages are especially helpful when you’re figuring out how a property or function works. For instance, we can learn:
- That text is nil by default, and has a public setter and getter
- When we change the text property, the value of attributedText – for styled text – also changes
- When we don’t use attributed text we can use the shadowColor, textAlignment and other properties to stylise the text.
When you scroll down, you can also see a bunch of related documentation. The guides are particularly helpful, such as About Text Handling in iOS. Are you starting to get a sense of how huge the documentation really is?
Going back to the class overview page, there’s a few more things that stand out:
- You can often find related enums and structs for a class, such as NSTextAlignment for a UILabel. This is helpful when you want to find out what options a particular property or function has, when they use a specific enum.
- On most pages, classes, structs, functions, enums, frameworks etc. can all be clicked to dive in deeper. For instance, from UILabel you can get to UIView, NSCoding, CGRect, UIColor, etcetera.
- On pages that document a class, function or property that has changed between iOS versions you can click the API changes button in the top-right corner of the page. You can select an iOS or Xcode version to compare with, and see at a glance which components have been modified, added or deprecated. This is particularly helpful when you’re upgrading an app or when Xcode tells you’re working with a deprecated API.
- Some pages list example projects, such as Handling 3D Interaction and UI Controls in Augmented Reality. You can download the Xcode project and Swift source code instantly, and play with the app. Many of those sample projects have tutorials that explain how the project works – awesome!
Deprecation means that a class, function or property (“API”) has been marked for removal in a future version. The function still works right now, but if you use it you risk that it won’t work in the future. It’s always recommended to upgrade your code when you see a deprecation notice.
Apple’s Design Resources
Most developers think that the Human Interface Guidelines are design rules that your app needs to follow.
But that’s not the case, because they’re guidelines. And they’re pretty good at guiding you through best practices for UI/UX design of iOS apps!
Take the Interface Essentials, for instance. They categorise user interface components as either being Bars, Views and Controls.
- Bars are used for navigation, showing people where they are in your app, and providing buttons for initiating action.
- Views contain the information people see in your app, like text, graphics, animations and interactive components. Views can also often be scrolled, rearranged, removed and added back in again.
- Controls can both contain information and enable actions, like a 2-for-1. A good example is the toggle switch, that both shows an on-off setting and allows the user to change the setting by flicking the switch.
These components are used uniformly throughout iOS frameworks, so you can rely on standardised UI and interaction. Moreover, when you’re confused about how to design a particular feature in your app, you can use the guidelines as a basis.
The Human Interface Guidelines contains a lot more information, and it’s especially helpful to see what the default way of designing iOS apps is.
If you haven’t checked it out before, make sure you do – there’s a lot in here that helps your understanding of iOS development and design. If you think that a developer doesn’t concern herself with design, think again! Building apps is as much about writing code, as it is about creating great UI/UX.
A few key resources are:
- App Architecture that shows how accessibility features, loading and waiting, modal dialog alerts, permissions and onboarding works.
- User Interaction like gestures, drag-and-drop, and working with files, show you how interactions in your apps work best.
- Visual Design and Icons and Images show you how to work with adaptive layouts, app icons, different devices, Retina displays, how to use iOS terminology, animation and color. You’ll want to do this differently in your own apps of course, but it’s never a bad idea to see a starting point.
- Technologies explains you how to best incorporate Apple-provided in-app tools such as augmented reality, In-App Purchases, iCloud and HomeKit in your apps. Especially its “consider this and that”-type remarks are helpful.
- Extensions show you how to integrate more tightly with the iOS operating system, such as working with custom keyboards, document sharing between apps, messaging and widgets.
And last but not least, check out the Design Resources. You can download Photoshop and Sketch files with graphics templates for every Apple platform, and you can download device mockups – images of iPhones – to use in your marketing.
App Marketing Resources
Apple’s developer resources don’t just focus on design and development. Marketing is a big part of building apps too!
You’ll find resources about app marketing, App Store and app business on the Apple Developer portal. With $86 billion paid out to developers, it’s no surprise that Apple wants to help you generate revenue in the App Store.
Compared to the Apple Developer Documentation, the pages about the App Store look a lot like they’re trying to sell you something. Full-page images, stylised screenshots and snappy text – it doesn’t exactly look like a library, right?
It’s because the resources are aimed at app marketers, as opposed to programmers. Don’t let it fool you – as an indie developer, and even as a programmer, it pays dividends to dig into these App Store marketing resources.
Here’s what I find helpful and interesting:
- iOS 11 has a brand new App Store design, and that comes with new marketing features. You can read about them on this page: The All-New App Store.
- Planet of the Apps didn’t impress me, but Developer Insights features a ton of insightful case studies from app developers. Especially the interviews about branding, business models, user experience design and community outreach are a must-watch.
- The Submitting Your Apps page has a helpful overview of the app submission process. And of course the App Store Review Guidelines tell you exactly what rules you need to follow and requirements you need to address, before your app is allowed in the App Store.
- Making the most of your App Store product page is helpful if you want to optimise your in-App Store page for clarity, usability and app marketing. It’s a good resource to get you up to speed on app marketing, and even App Store Optimization. (Fun fact: “app store optimisation” is a word Apple uses nowhere on their website…)
An often overlooked piece of documentation is iTunes Developer Help. You’ll need to log in with your Apple Developer Program account ($99/yr) to read it. It has helpful pages about iTunes Connect, and also explains how paid apps, In-App Purchases, App Analytics and App Store promotions work.
So… now you know! You don’t need to Google every iOS development question all the time. You have a huge library of information at your fingertips – so dig in.
Why don’t you do some pro-active reading and work on your understanding of the different iOS development frameworks? The sum is greater than its parts, as they say, and you’ll find that getting a grip on an unrelated iOS topic helps your understanding of the components, concepts and frameworks you come across.
One last thing… I often use a Mac app called Dash to quickly look up iOS classes and functions. It supports offline mode, integrates with Xcode, and it can even search StackOverflow for questions about a particular topic. A must-have!
- How to Create an app like Best Buy?
- Top Tips to Avoid Your App From Being Rejected by Apple App Store
- How To Select Right Colors For Your Brand?
- 10 Best GitLab Integrations for Better Code Reviews
- 3 Questions All App Developers Should Ask Themselves
- Working with Timers in Swift
- 9 Fun & Creative Holiday Marketing Ideas to Try This Holiday Season
- How to Track Student Attendance in Microsoft Teams?
- How to Create an Amazing LinkedIn Banner
- Which are the Top 10 Apps to integrate with Pipedrive?
Most Popular Posts
- 10 Best Autotask Integrations for Network Monitoring
By Abhinav Girdhar | October 25, 2022
- 11 Apps That Every Teacher Should Have
By Abhinav Girdhar | May 10, 2020
- Best 10 Asana Integrations To Boost Productivity
By Jinsen John | October 27, 2022
- 5 Easy Steps to File a Complaint with the Better Business Bureau
By Abhinav Girdhar | December 20, 2019
- Best Heart Rate Apps That Developers Can Learn From
By Abhinav Girdhar | August 17, 2020