To generate a MacOS notification in Swift, you can use either the NSUserNotificationCenter or UserNotifications framework depending on the version of MacOS you are targeting.
main.swift263 chars11 linesmain.swift629 chars18 linesBoth methods allow you to customize the title, message, and sound of the notification as well as set a trigger for when the notification should be shown.
gistlibby LogSnag