Reputation: 333
I am creating an OSX App in Swift.
What I want is: when I press the icon in the mac top bar I want the window to be exactly underneath the icon like most preferences app do.
Thanks,
Upvotes: 0
Views: 285
Reputation: 2259
You can get the position of the mouse when the user clicks the statusbar and then you know where you can put your window:
NSEvent.mouseLocation()
Upvotes: 1