With another WWDC in history books — and it sure was one for the books — there are a slew of important and compelling session videos to watch!
There are videos on the latest APIs, such ARKit 3, RealityKit, SwiftUI, Combine and multiple window support on iPadOS. There are even more covering tools such as Catalyst, Xcode 11, Swift Package Manager, Accessibility Inspector and Simulator. With well over 100 session videos available, where do you start?
Fear not! The raywenderlich.com tutorial team has assembled its annual top 10 list of videos to watch. Actually, the number is closer to 20 because of the multiple sessions on some key new technologies, but what are a few extra videos among friends? ;] Even still, whittling the list down to 10-ish was difficult with over 40 videos nominated by the team. Here, then, is our list of “must see” videos for developers from all backgrounds and interests.
0) Platforms State of the Union – Session 103
The Platforms State of the Union is always the place to start. It provides a great overview of many of the new things Apple covers in the remaining sessions of WWDC. If you have time for nothing else, this is the one to watch!
This year’s presentation highlights changes in three areas:
Developer Productivity: The big news here is SwiftUI, along with new support in Swift and Xcode.
- SwiftUI is the shiniest of the new toys and is covered more below.
- Xcode has significant improvements to support live development, live previews, new editor layouts, improved documentation, test plans and more.
- The changes to Swift bring ABI and Module stability and first class support for Swift Packages both in Xcode and the GitHub Package Registry.
Platforms: In addition to SwiftUI, there are a ton of new features on each of the platforms.
- macOS Catalina includes Catalyst, which simplifies bringing iPad apps to the Mac. Apple has also made the system volume read-only in this new version, separating system-provided bits from user applications and data to improve security and reliability.
- watchOS 6 declares independence from the phone. It’s now possible to build apps for the watch without a companion iOS app.
- iOS 13 brings usability features such as a quick-type keyboard and new UI features like dark mode, share sheets, cards, semantic colors, adaptive materials and a new library of symbols.
- iPadOS includes new iPad-specific features such as improved multitasking, window scenes, PencilKit and new gestures.
Core Technologies: As always, this year brings a number of wide-ranging improvements to the core APIs on each platform.
- Accessibility: Apple focused heavily on accessibility this year during WWDC in an effort to encourage developers to pay more attention to it. They made accessibility features easier for a user to discover. And, they implemented voice control, which uses on-device speech recognition and some specialized commands to enable completely hands-free operation of the device.
- Privacy: Core Location now gives users the option of allowing an app to use location information only once. There’s also the “Sign in with Apple” service, which allows apps to register users using their existing Apple IDs.
- Machine Learning: Apple has extended the capabilities of the existing Vision, Natural Language and Speech ML frameworks. These new abilities allow apps to judge image saliency, perform text recognition, process speech on the device and much more. CoreML includes support for over 100 new model layer types and now allows for on-device personalization of models.
- Siri: Siri Shortcuts are now conversational, allowing them to handle parameters.
- AR: ARKit 3 enables simultaneous camera usage, people occlusion and motion capture. RealityKit and Reality Composer provide a simpler way to integrate AR features into apps.
- Metal: Among other enhancements, the iOS Simulator now fully supports Metal apps.
1) Great Developer Habits – Session 239
Even with all of the incredible and shiny new toys Apple has given us this year, this session is the one our team thinks is most important for you to watch. It synthesizes the results of many conversations with developers all over the world and makes the case for incorporating a number of habits into your daily workflow.
The talk collects these habits into eight categories:
- Organize: Keep your project and your workspace clean. This means using Xcode groups, storyboard references and the new build system. It means treating warnings as errors and never checking them in.
- Track: Always use source control. Make your commits small and localized. Write GOOD commit messages. Think of them as a note to your future self.
- Document: Thinking again of your future self, write comments that answer the question “why” you implemented something the way you did. Write API documentation for the same reason.
- Test: Write unit tests. Just do it. And make sure you actually use them.
- Analyze: Use the tools Xcode provides such as the Network Link Conditioner, the debug gauges and Instruments. Use the sanitizers and checkers and simply leave them turned on whenever possible.
- Evaluate: Do code review. If you’re a solo developer, find someone to help do it. Understand each change. Build it. Run the tests. Proofread.
- Decouple: Use packages and frameworks to break up your code into more easily maintained pieces. Doing so can make it easier to scale or share your code. But, this means documentation is critical.
- Manage: Manage your dependencies. Know what they do with your users’ data. Have a plan for what happens if they break or disappear. And know the same for each dependency they include.
2) Introducing SwiftUI: Building Your First App – Session 204
SwiftUI: Less code. Better code. Everywhere.
That’s Apple’s mantra for SwiftUI, and it’s not just marketing hype. In some ways, SwiftUI may be more revolutionary for developers than the introduction of Swift itself. This session introduces this new framework with a demonstration of building an app from scratch. It highlights the power of SwiftUI and of a new way of developing user interfaces.
Of course, nothing this big can possibly be covered in a single session. Once you’ve seen this one, there are five more for you to watch to really begin to understand how to put SwiftUI to work for you. In order, they are:
- SwiftUI Essentials – Session 216
- Data Flow Through SwiftUI – Session 226
- Integrating SwiftUI – Session 231
- Building Custom View with SwiftUI – Session 237
- SwiftUI On All Devices – Session 240
Even still, that’s not all of the great SwiftUI content available. There are more sessions on topics such as accessibility and watchOS support. Take advantage of the ability to download the slides for these sessions. You’ll want them for reference over and over again.
3) Modern Swift API Design – Session 415
This session covers some emerging best practices for designing Swift-only APIs. Now that Swift provides both ABI (Application Binary Interface) and Module stability, it’s finally possible to build system frameworks entirely in Swift. SwiftUI and RealityKit are two shining examples.
The overall guiding principle of Swift API design remains the same as it was in 2016 when Apple first released its Swift API guidelines: Clarity at the point of use. While this obviously means that naming must be clear, it also means that usage must be clear.
The session addresses best practices for choosing between value and reference semantics or a mix of both, such as copy-on-write value semantics. It goes on to address appropriate use of protocols and generics and to identity common cases of misuse.
Finally, it shows how dynamic key path member lookup and property wrappers work together to enable some of the cool new capabilities used by SwiftUI.
4) What’s New in Xcode 11 – Session 401
This session presents and demonstrates many of Xcode 11’s new features. It starts by demonstrating the new workflows enabled by the completely rethought editor. Xcode now has as many independent editors as you like, each with its own mode and content. The canvas and the assistant editor are merged into the editor pane and display only when there is something to show. Split your workspace as many times as you like, both vertically and horizontally.
Xcode 11 also now provides full integration of Swift Package Manager. Swift packages are first class citizens, both in Xcode and in popular repositories such as GitHub, GitLab and Bitbucket. Moving from CocoaPods to SwiftPM couldn’t be easier! ;]
The session also covers a smorgasbord of other Xcode improvements including Git stash and cherry-pick, Mac device support in Storyboards, localization of assets in catalogs, environment overrides, better tracking of
os_signpost logging in Instruments and many more.
os_signpostlogging has you scratching your head, check out our tutorial Migrating to Unified Logging: Console and Instruments.
5) Introducing Combine – Session 722
This session introduces the new Combine framework. Using Apple’s words Combine is “a unified, declarative API for processing values over time.” Fans of third-party reactive programming frameworks will say, “But, we already have this!” What makes Combine exciting is that it’s not a third-party framework. You finally have a declarative solution to a number of asynchronous programming problems as part of the base operating system.
Combine thinks in terms of Publishers, Subscribers and Operators. Publishers, as you might expect, are the source of values and define how both values and errors are produced. Subscribers register with Publishers to receive those values. Operators act as both Publisher and Subscriber, transforming values received from a Publisher and sending them downstream to a Subscriber. This “dual identity” for Operators enables them to be chained together to handle more complex data flows.
Combine provides a host of pre-defined operators which Apple calls its Declarative Operator API. These operators are grouped into functional areas such as transformations, list operations, error handling, thread or queue movement, and time and scheduling.
As with SwiftUI, there’s more to say about Combine than fits in one session. Once you’re ready to do more with Combine, watch session 721, Combine in Practice. And, if you’re new to “reactive” programing, be prepared to watch these sessions several times!
6) Advances in UI Data Sources – Session 220
Anyone who has written many apps using
UICollectionView has almost certainly encountered the dreaded crash that comes when a data model gets out of sync with the UI. Even if you’re lucky enough not to have seen this crash, you’ve experienced the difficulties of keeping them synchronized and making incremental updates to the UI.
This session introduces a new approach: diffable data sources. These work by using a new, three step process: create a snapshot, populate that snapshot, call
apply(). It’s the simple!
Data items in a snapshot are identified by unique, enduring identifiers, not by
IndexPaths. The only requirements for a valid identifier are that it must be unique and it must conform to
Hashable. Since it’s trivial to make your own Swift
struct values meet these requirements, it’s possible to use your model values directly rather than looking them up based on an identifier. This can drastically simplify your code.
Since a number of table view and collection view delegate methods still reference cells by
IndexPath, there is an API to translate between
IndexPath and identifier.
Once you’ve made the snapshot reflect the new state of your data model, you put the update on screen by calling
apply(). The system takes care of working out insertions and deletions, all while providing smooth, automatic animations. Of course, you can disable the animation if your user experience calls for that. And, best of all, you can call
apply() on a background thread! The only restriction is that you must always call it either on a background thread or on the main thread.
7) What’s New in Swift – Session 402
Since WWDC 2018 last June, Apple has finalized and shipped Swift 5.0, and Swift 5.1 is in beta as part of Xcode 11. This talk highlights a number of the changes to Swift over the past year.
One of the most important new features is ABI — Application Binary Interface — stability in Swift 5.0. This allows programs to use frameworks built with a different compiler than the one which built the program itself. Swift 5.1 introduces Module stability, enabling Swift modules and the programs that import them to be build with different compiler versions. This enables bundling frameworks and the Swift run-time with the operating system — matching the state of the world that exists with Objective-C — which gives smaller binaries and faster app launch.
Having the Swift run-time ship with the operating system allows other performance benefits as well. It’s now possible for Apple to optimize the bridging of what they call currency types — common types such as
Dictionary — resulting in significant improvements in bridging performance.
Swift 5.0 changed the way the compiler represents strings; they are now encoded as UTF-8 instead of UTF-16. You may have encountered this in your own code if you depended on the underlying representation of
String. This change allows simpler interoperability with C APIs because the strings no longer require conversion. It also allows faster bridging between
NSString types, improving overall app performance. For example, SwiftNIO experienced a 20% increase in throughput as a result of this change.
The session also addresses tooling improvements, such as the officially supported Docker image and Language Server Protocol (LSP) support in SourceKit. It also covers some of the new language features that have been approved, or are currently in review, that enable some of the cool new technologies, such as Swift UI.
8) Adopting Swift Packages in Xcode – Session 408
As mentioned above, Xcode 11 now supports using Swift Package Manager (SPM) to manage dependencies on external, open-source packages. This session begins with another demonstration of how easy it is to add a dependency to an Xcode project.
Similar to other dependency managers, SPM uses a form of manifest to define a package. For SPM, that manifest is a file called Package.swift. In addition to this file, a package contains a Sources directory and a Tests directory, each containing additional directories for each target the package defines. Sources can be written in any mix of Swift, C, C++ and Objective-C. By default, packages build as static libraries and link directly into the resulting app executable.
Swift Package Manager uses semantic versioning to implement revision control for packages. This provides for logical, intelligent version selection during package resolution. SPM uses the modifiers
.upToNextMinor(from:) to control version selection. Xcode exposes this same ability in its dialogs.
Updating to the latest qualifying package versions couldn’t be more simple: a single menu command. If you’re familiar with using SPM from the command prompt, it’s the same as performing
swift package update. The magic in versioning is a file called Package.resolved where SPM records the exact version of each package it resolves. You should be sure and check this file into your source control system to ensure each member of your team is using the same version you are.
If you want to create your own packages, check out session 410, Creating Swift Packages.
9) Introducing Sign In with Apple – Session 706
Sign In with Apple is a new service which enables your app to provide streamlined account set up for your users. It allows your user to tap a single button, quickly approve the information you requested, and authenticate with Apple. You get great privacy, great security — the login is guaranteed to be secured with two-factor authentication — and a verified email address, all with essentially no work on your part.
Integrating Sign In with Apple into your app consists of four steps:
- Configure and show the button. There are several styles and appearances to choose from.
- When your user taps the button, create and send an authorization request. This is where you specify the additional information, such as full name or email, that you require.
- Respond to the verification callbacks. You receive a number of different data items, including a unique, stable user ID and a “real user indicator” that gives you a high confidence indication that this user is an actual person and not a bot. Use this information to configure the account in your app.
- Respond to changes in authorization status.
The session also shows you how best to sign users in, using not only the new button but existing iCloud keychain passwords, if they exist. If your app requires users to register for an account, it’s worth taking the time to watch this session and study the slides to implement the lowest friction, friendliest user experience.
10) LLDB: Beyond “po” – Session 429
The session explains the three different LLDB commands for displaying values when debugging a program. po is the first command we all learn when trying to debug programs in Xcode. It prints the object description of the specified variable. The system run-time provides a default object description, but you can customize it by making your type conform to
The argument to po can be anything that’s compilable. The command actually generates code snippets which are compiled with the embedded compiler and executed in the context of your program. It wraps the result in another function to get the description. That description is what it displays.
Next, comes p. Think of it as “print without the object description”. It does the same thing as po up through the first result. After doing some type resolution, it passes the result to the appropriate formatter. LLDB provides formatters for many common data types, so their representations match what we expect in the console.
The third way to examine values in LLDB is the v command. This is an alias for the
frame variable command, and it doesn’t compile and execute code. This makes it fast but means that it doesn’t use syntax that matches the source language of the debugged program.
The session wraps up by demonstrating ways to customize or supplement the built-in data formatters. And, it provides a reminder that the version of LLDB in Xcode 11 now uses Python 3, and not Python 2, as its scripting engine.
10+) Advances in Collection View Layout – Session 215
Here’s a bonus video; it’s too important to leave off of the list!
When collection views were introduced in iOS 6, they opened the door to more complex UI designs. The secret to their power is the collection view layout, which separates rendering and handling user interactions from the actual placement of items. While Apple has provided a single, line-based layout engine —
UICollectionViewFlowLayout — building anything more complex has required writing a custom layout class.
But, custom layout can be hard to get right. It involves lots of boilerplate code; it can be difficult to ensure fast performance. Laying out supplementary and decoration views correctly can seem like black magic. And, nesting collection views in order to create the scrolling behavior your designer desires can involve many a late night working out the proper coordination.
Compositional Layout to the Rescue!
New this year are
NSCollectionViewCompositionalLayout, providing a whole new way to create your layouts on all of Apple’s platforms. When you adopt compositional layout, you compose your layout from smaller units, building into ever larger components until you have your complete layout.
Conceptually, there are four levels of building blocks: items are collected into groups, which are collected into sections, which are collected into the final layout. Groups are, themselves, items, allowing you to nest them. A layout can be defined with a closure which vends sections on demand, allowing you to mix completely different layout strategies inside your single collection view.
There is so much more to this new layout engine. The session provides a downloadable demo app that illustrates how easy it is to build many complex layouts. After you watch the session, be sure to grab it and play with it!
Where to Go From Here?
The videos in this list only scratch the surface of all of the amazing content available from WWDC 2019. Don’t forget to check out the rest of the list, too!
What do you think are the “must see” videos of the conference? Tell us in the comments below!