I have been trying to develop a simple program that sits in the Mac's status bar. I need it so that if you left click, it runs a function, but if you right click it displays a menu with an About and Quit item.
I have been looking but all I could find was command or control click suggestions however I would prefer not to go this route.
Thanks in advance and any help appreciated!
for this you can use statusItem button property.
then you implement the action function, in the above code I named it "statusItemClicked"
Swift 3
Swift 4
A longer post is available at https://samoylov.eu/2016/09/14/handling-left-and-right-click-at-nsstatusbar-with-swift-3/