Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift notifications mac

func showNotification() -> Void {
    var notification = NSUserNotification()
    notification.title = "Test from Swift"
    notification.informativeText = "The body of this Swift notification"
    notification.soundName = NSUserNotificationDefaultSoundName
    NSUserNotificationCenter.default.deliver(notification)
}

self.showNotification()
 
PREVIOUS NEXT
Tagged: #swift #notifications #mac
ADD COMMENT
Topic
Name
1+1 =