Show system alert or notification from Swift script -


i want show system alert or notification swift script. example, if there more 30 files in desktop folder, want see kind of notifications. how can it?

to send local notification, think have use this:

func shownotification() -> void {     var notification = nsusernotification()     notification.title = "test swift"     notification.informativetext = "the body of swift notification"     notification.soundname = nsusernotificationdefaultsoundname     nsusernotificationcenter.default.deliver(notification) } 

there detailed tutorial here


Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -