Apple's September event just finished, and here's what we learned
Apple just finished its September 2017 keynote, with a whole barrage of new announcements to help consumers the world over lighten their wallets. But developers get new toys too: the gold master of Xcode 9 just shipped with some new APIs for us to work with, which means that Swift 4 is now final.
Plus, Apple just released 14 new developer videos covering topics such as designing for iPhone X’s notch, updating your app for Apple TV 4K, and face tracking with ARKit.
It’ll take some time to dissect all the improvements, but here are some immediate things to think about:
navigationItem.searchController
property when presenting search controllers, so the text entry box stays clear of the safe areas.There are some new APIs for us to start using as soon as you’ve downloaded the Xcode 9 GM.
For example, you can override prefersHomeIndicatorAutoHidden()
in your view controller and make it return true to have the home indicator hide itself after a few seconds, like this:
override func prefersHomeIndicatorAutoHidden() -> Bool {
return true
}
You need to implement that on every view controller that should hide the home indicator. There’s an accompanying setNeedsUpdateOfHomeIndicatorAutoHidden()
method to force UIKit to re-read the auto-hide setting.
There’s a new biometryType
property of LAContext
that lets us read whether the device supports Face ID, Touch ID, or neither, like this:
let context = LAContext()
if context.biometryType == .typeFaceID {
// Face ID
} else if context.biometryType == .typeTouchID {
// Touch ID
} else {
// Stone Age
}
Apple also released a big collection of face tracking APIs for ARKit, although because they are supported only on iPhone X I’m not in a position to test out some code for them – yet!
Right now my best advice is this: fire up Xcode 9, launch the iPhone X simulator, and just start getting used to it. The notch at the top is strange at first (and will cause all sorts of status bar problems, I'm sure!), but the rounded corners are particularly problematic – you need to respect the safe areas, otherwise your views will get clipped.
If you’ve spotted something not in the list above, please tweet me @twostraws or email paul@hackingwithswift.com.
SPONSORED Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!
Sponsor Hacking with Swift and reach the world's largest Swift community!
Paul Hudson is the creator of Hacking with Swift, the most comprehensive series of Swift books in the world. He's also the editor of Swift Developer News, the maintainer of the Swift Knowledge Base, and a speaker at Swift events around the world. If you're curious you can learn more here.
Link copied to your pasteboard.