-
-
Save dinneo/045746d2a71c8e66b9d340c8846d5d4c 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 { | |
var notification = NSUserNotification() | |
notification.title = "Test from Swift" | |
notification.informativeText = "The body of this Swift notification" | |
notification.soundName = NSUserNotificationDefaultSoundName | |
NSUserNotificationCenter.defaultUserNotificationCenter().deliverNotification(notification) | |
} | |
//showNotification() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment