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.
SAVE 50% To celebrate Black Friday, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.