There were some nice announcements from Apple at WWDC yesterday, including a revamped lock screen and notifications for iOS, SiriKit, and a lot of iMessage integration. Whilst scouring the newly-released developer documentation I’ve come across a lot of interesting tidbits that aren’t headline features on their own, so I thought I’d collect them here in case they’re of use to anyone else. In no particular order:
- Some nice improvements to Interface Builder. You can now edit your UI at any zoom level (FINALLY)! The UI for customizing layouts for different device traits has also been revamped, and looks really good.
- Image and colour literals are now supported in Swift code, including code completion for images that’re in your asset catalog. Simply start typing either
- There’s a new monospaced code font in Xcode:
SF Monothat seems to match up with the WWDC promo material this year.
- The simulator features a special version of the Messages app which allows you to see both halves of a conversation between two users. Very useful for testing all the iMessage newness.
- Xcode 8 supports both Swift 2.3 and Swift 3. If you choose Swift 2.3 for a project, there’s a new build setting that gets set to Yes: “Use Legacy Swift Language Version”.
- The new memory debugger looks incredible. You can visualize the current object graph, and it can help identify memory leaks / retain cycles.
- Xcode now highlights the active line when editing.
- There’s now
NSDateIntervalfor counting the duration of a time interval, checking whether a date exists in a range, and comparing intervals.
- FINALLY an ISO 8601 date formatter.
NSPersonNameComponentsFormatterhas a new
personNameComponentsFromString:method that can parse out the individual components of a person’s name.
- The User Notifications UI framework lets you customize the appearance of local and remote notifications when they appear on the user’s device.
- You can also intercept push notifications (through
UserNotifications.framework) and handle them before they alert the user. For example, you could download a video and then tell the user it’s ready.
- Rich notifications are currently only optimized for 3D Touch, and they’ll be providing access to functionality for users of other iPhone models / iPad at a later date.
- A lot of the existing remote and local notification methods on
UIApplication(as well as
UILocalNotificationitself) are now deprecated in favour of the
- There’s a load of new animation APIs: “New object-based, fully interactive and interruptible animation support that lets you retain control of your animations and link them with gesture-based interactions.”
- The refresh control is now supported in all scroll views and scrollview subclasses thanks to
- Collectionviews and tableviews support prefetching of cells to improve scrolling (
- It looks like you can now provide your own previewing UI for 3D Touch:
- There are new UIVisualEffectView blur types: prominent and regular.
NSPersistentContainerlooks like it might replace the simple
CoreDataStackclass I’d add to most new projects. It encapsulates the whole core data stack, and has convenience methods for creating new background contexts and performing background tasks.
NSManagedObjectgets a few new methods –
- Xcode should be able to automatically generate classes for Core Data entities, but I’ve been unable to get this to work so far.
NSManagedObjectContextnow has an
automaticallyMergesChangesFromParentproperty to do the
NSManagedObjectContextDidSaveNotificationobservation and merging automatically.
- On iPad,
XCPlaygroundis replaced by
- You can record videos of coding sessions right inside the app (in the Share menu).
- Glances have gone completely in watchOS 3. Your app should now display and update glanceable information when the user has it in their Dock.
- If the user has your complication on their watch face, your app will be kept in a ready-to-launch state.
WKCrownSequencerlets you directly access information about the crown’s state – whether it’s rotating, how fast, and when it’s stopped.
- SpriteKit and SceneKit on the watch is cray-cray. The State of the Union contains a cool demo where a notification on the watch contains an animated 3D SceneKit scene.
- You can now access information about the watch’s orientation, crown position, wrist location, etc in
- If you’re using a watch app, whenever you lower and raise your wrist, you’ll get taken right back into the app, for up to 8 minutes.
- SiriKit is limited to only certain domains:
- Audio or video calling
- Sending or receiving payments
- Searching photos
- Booking a ride
- Managing workouts
- If you’ve indexed content for your app with Core Spotlight, you can now search it programmatically in-app using
CSSearchQuery. A user can also continue a Spotlight search inside your app.
- Speech recognition is now possible, through the Speech framework and
- You can set an expiry or exclusions for pasteboard data for the new universal clipboard.
- iOS 10 drops support for the iPhone 4S, iPad Mini, iPads 2 and 3, and the 5th generation iPod touch.