-
-
Save zachbrown-bm/b46fd84fa9131df03b133ce5be3f527d to your computer and use it in GitHub Desktop.
Deliver an OSX notification with Swift
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 showNotification() -> Void { | |
let notification = NSUserNotification() | |
notification.title = "Test from Swift" | |
notification.informativeText = "The body of this Swift notification" | |
notification.soundName = NSUserNotificationDefaultSoundName | |
NSUserNotificationCenter.default.deliver(notification) | |
} | |
//showNotification() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment