Presented at iOS Conf SG: http://iosconf.sg/
Most iPhone users don’t bother installing any apps per months. And worse, ~80% never use an app they’ve installed again. The future of mobile is clearly not app, but features. Features that make the iPhone ecosystem still a native experience, but as open and flexible as the web. Learn how you could prepare for that future.
17. "As speech recognition accuracy goes from say 95% to 99%, all of us in
the room will from barely using it today to using it all the time. Most
people underestimate the difference between 95% and 99% accuracy -
99% is a game changer" - Andrew NG, Chief Scientist at Baidu
18. SIRI INTENTS
▸ Audio or video calling
▸ Messaging
▸ Payments
▸ Searching photos
▸ Workouts
▸ Ride booking
58. // AppDelegate
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([Any]?) -> Void) -> Bool
{
if userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let webpageURL = userActivity.webpageURL
{
// separate webpageURL using NSURLComponents
// present the correct View Controller if valid
// otherwise, open link in Safari
}
return false
}
64. CREATING AN ACTIVITY
// GelatoDetailViewController
override func viewDidLoad() {
super.viewDidLoad()
// other config here
let activity = NSUserActivity(activityType: "com.natashatherobot.GelatoFinder.gelato")
// will show up as this in Spotlight Search Results
activity.title = gelato.name
// Other keywords to search by
activity.keywords = Set([gelato.name, "gelato"])
// should be handed off to another device?
activity.isEligibleForHandoff = true
// should be indexed in App History?
activity.isEligibleForSearch = true
// should be eligible for indexing for any user of this application?
activity.isEligibleForPublicIndexing = true
// Avoid deallocating before indexing,
// global variable declared in UIResponder class
userActivity = activity
// don't forget to activate!
userActivity!.becomeCurrent()
}
65. SAVE UNIQUE INFO
// GelatoDetailViewController
override func viewDidLoad() {
// create activity and other config here
activity.delegate = self
activity.needsSave = true
// assign to userActivity, etc
}
extension GelatoDetailViewController: NSUserActivityDelegate {
func userActivityWillSave(_ userActivity: NSUserActivity) {
// info needed to recreate activity!
userActivity.userInfo = ["index": gelatoIndex]
}
}