Skip to content

Instantly share code, notes, and snippets.

@3257
Created March 1, 2018 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3257/fed4350e00158b65f046358ddd4d2be2 to your computer and use it in GitHub Desktop.
Save 3257/fed4350e00158b65f046358ddd4d2be2 to your computer and use it in GitHub Desktop.
+ func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
+ if response.actionIdentifier == "like" {
+ print("Handle like action identifier")
+ } else if response.actionIdentifier == "save" {
+ print("Handle save action identifier")
+ } else {
+ print("No custom action identifiers chosen")
+ }
+ // Make sure completionHandler method is at the bottom of this func
+ completionHandler()
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment