Last active
September 18, 2018 10:32
-
-
Save WildStudio/fadf3cef55216ef04b55efb7ab637905 to your computer and use it in GitHub Desktop.
Handle intents on continueuserActivity:NSUserActivity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { | |
let type = userActivity.activityType | |
if let name = userActivity.userInfo?["name"] as? String where type == NSStringFromClass(INSendMessageIntent.self) { | |
let alert = UIAlertController(title: "User Activity", message: "Continue Activity: \(name)", preferredStyle: .alert) | |
window?.rootViewController?.present(alert, animated: true, completion: nil) | |
} | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment