Skip to content

Instantly share code, notes, and snippets.

@3257
Created February 1, 2018 16:56
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/3855674d01528feaade4140839f2cacc to your computer and use it in GitHub Desktop.
Save 3257/3855674d01528feaade4140839f2cacc to your computer and use it in GitHub Desktop.
// 6. Add some actions and add them in a category which is then added to the notificationCategories
let likeAction = UNNotificationAction(identifier: "like", title: "Like", options: [])
let saveAction = UNNotificationAction(identifier: "save", title: "Save", options: [])
let category = UNNotificationCategory(identifier: "unicorning", actions: [likeAction, saveAction], intentIdentifiers: [], options: [])
UNUserNotificationCenter.current().setNotificationCategories([category])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment