Skip to content

Instantly share code, notes, and snippets.

@WildStudio
Last active September 18, 2018 10:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save WildStudio/fadf3cef55216ef04b55efb7ab637905 to your computer and use it in GitHub Desktop.
Handle intents on continueuserActivity:NSUserActivity
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