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
Post a Comment