Slide 11
Slide 11 text
Responding to Quick Actions
On launch, via app delegate launch methods:
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// If a shortcut was launched, display its information and take the appropriate action
if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem
where shortcutItem.type == "myType" {
// do something associated with "myType" shortcut and its userInfo data payload
}
// ...
return true
}
On activation or if launch methods returned true,
via the new method, performActionForShortcut: