WWDC 2016 Recap: Swift 3.0, Xcode 8, and Interface Builder


Last week, Apple held the 2016 edition of their annual Worldwide Developers Conference (WWDC). Each year, a massive amount of people tune in to the keynote address via live streams and blogs to hear about all the new features coming to iOS and the rest of the Apple landscape. Then, a second keynote-style event, the Platform State of the Union, is streamed a few hours later (and with much less media fanfare). In this talk, Apple dives deeper into an overview of the major changes to their frameworks and tools from a developer standpoint rather than that of a consumer. Today, we’ll break down some of the major updates to languages and developer tools from that two-hour presentation.



Swift 3.0

Swift was open-sourced back in December 2015, and since then it’s been possible for anyone to follow along with the progress of the language toward version 3.0. The first official preview branch of Swift 3.0 was released at WWDC and bundled with Xcode 8.
The biggest change that 3.0 brings is a rewrite of the APIs of many different frameworks to be more Swift-like. Many UIKit and Foundation classes and methods have slightly modified names now, likepresentViewController(_:animated:completion:) becomes present() with arguments for the view controller, animated boolean, and completion block, and C APIs like Grand Central Dispatch and CoreGraphics now have new Swift value type equivalents. Having to switch contexts less means you’ll be able to write more consistent code with less bugs, but it also means a lot of Swift 2.2 and lower code will have lots of errors when you first open old projects. Thankfully, there’s a migration tool in Xcode 8, and when we ran it on some of our Swift 2.2 code, we were able to update it all without too much pain.

Xcode 8

Apple’s been releasing a new major version of Xcode each year, and my initial impression is that it’s a bunch of smaller improvements that add up in a big way. One example is color and image literals — Xcode 8 will automatically recognize any images you’ve got in an Asset Catalog and offer them up as a suggestion inside of a UIImage initializer. Under the hood it’s creating code that looks like this:#imageLiteral(resourceName: "myImage.png"). But inline in the source editor, you’ll just see the file name of the image.
There’s also some great new debugger views for fixing Auto Layout ambiguous constraints, viewing thread-related issues, and a memory debugger that draws your object graph in a visual way and helps you prevent memory leaks.

Interface Builder

Interface Builder now gives a full preview of how things will render on a device, so you won’t have to build and run just to see how things will look. The thing I’m most excited about, though, is the updated size class bar. Instead of having to keep track of what Regular, Compact, and All mean in various sizes and orientations, the size classes selector is now just a bar that shows icons that represent the currently available device sizes, and it’s really easy to see which one is currently active as you’re adding size-specific views and constraints.

All the Rest

There were also substantial updates to iOS, watchOS, macOS (that’s right, OS X has been renamed), tvOS, as well as new tools and enhancements that all of the platforms benefit from, like priority traffic over networks, a new logging system, a new file system, and some cool privacy-related updates that will allow data and metadata to be even more anonymous while still allowing Apple to use that data to make better suggestions and improve their products.
Previous
Next Post »