What’s new in iOS 10 for developers
Not only users were introduced to the new features in iOS 10, but also the developers had lots of new functionality available for implementation. While users were somewhat controversial about new features (including new way of unlocking the device which is eventually a way more convenient than the previous one according to the author) the developers face mostly novelties for extending possibilities of mobile applications.
1. Swift 3
It was the presentation of a new version of Swift (Swift 3) that was highly anticipated. This new version made syntax of the language simplified, standardised, and finally concise which is not of the least importance. A small example:
NSUserDefaults.standardUserDefaults().setInteger(14, forKey: SOME_KEY) NSUserDefaults.standardUserDefaults().synchronize() let storedInt = NSUserDefaults.standardUserDefaults().integerForKey(SOME_KEY) prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) viewController.prepareForSegue(segue, sender: senderObject)
UserDefaults.standard.setValue(14, forKey: SOME_KEY) // Shorter class name + Universal setter // No more sync method needed UserDefaults.standard.integer(forKey: SOME_KEY) prepare(for segue: UIStoryboardSegue, sender: Any?) // No more first param name in method name. // P.S. at last we allowed to pass Any type in segue :) viewController.prepare(for: segue, sender: senderObject)
2. New debugging instruments
Two new tools which let you diagnose and send any possible mistakes in the code were introduced. Thread Sanitizer - a tool for analyzing possible threading issues. Here’s a good example of how to use it.
Memory Graph Debugger - instrument for visual view and filtering objects in the heap in the Debug navigator. This brings your attention to objects you didn’t expect to see — for instance, hidden links or duplicate / nil objects.
3. Messages extensions
iOS 10 got new extensions for Messages app, i.e. Sticker Pack and iMessage App.
Sticker Pack makes it possible to add custom emojis/stickers/gifs for sending in Messages.
The latest enables users to fulfil full-scale operations within the apps. For example, it’s now possible to make any transaction (let’s say a money order or refill) in a banking app and add the result notification to the message. Or you can send a song from your playlist in the message.
4. Siri Kit
Apple provided us access to their Siri voice assistant in new iOS. The list of possible functions available for the use is not long though:
- VoIP calling;
- Photo search;
- Ride booking.
However these functions make it possible to upscale your app’s features. We hope that there will be more functions available for us down the road, including some custom phrases for controlling an app.
5. UIView animation new features
iOS developers got a new and quite flexible tool for animation modification - UIViewPropertyAnimator. It enables you: - to create dynamically modified animations (there are pause, resume, stop and gestures processing) - to modify existing and even running animations; - to carry out reverse animation; - to set not only default timing functions (easeInOut, easeIn, easeOut, linear), but to create your own, using two control points. You can watch a video from WWDC 16 to learn more information about a new class and corresponding protocols.
This article reflects the main changes and innovations in iOS 10, though not all of them by far. For example, you can also learn new frameworks CallKit, CareKit, updates in CoreData, Foundation, Cocoa Touch and many more novelties for Apple devices. For the full list of innovations visit WWDC.