Skip to content

Instantly share code, notes, and snippets.

@KevinGutowski
Created July 19, 2019 02:06
Show Gist options
  • Save KevinGutowski/2d48cbd3c44c38fa836df335f6eb7c08 to your computer and use it in GitHub Desktop.
Save KevinGutowski/2d48cbd3c44c38fa836df335f6eb7c08 to your computer and use it in GitHub Desktop.
Create a notification within a sketch plugin
let notification = NSUserNotification.alloc().init()
let randomNumber = Math.random()
notification.setIdentifier("com.kevin.testNotification" + randomNumber)
notification.setTitle("Hi there")
notification.setSubtitle("What about this?")
notification.setInformativeText("Your symbol")
notification.setSoundName = NSUserNotificationDefaultSoundName
let notificationCenter = NSUserNotificationCenter.defaultUserNotificationCenter()
notificationCenter.deliverNotification(notification)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment