I'm new to OSX development (I've done a little iOS stuff, but this is my first OSX app, and my first Swift app).
I've found several tutorials for how to make a MenuBar app with just a simple list of menu items, like the following:
But I'm looking for something more like Evernote's, or Google Drive's, or Mint's MenuBar window:
I believe that to do something like the latter, I need a regular NSWindow that is just toggled by clicking the status item (right?), but how do I go about positioning the window the way Evernote & Google do?
I've found this question that gives a couple of ways to get the status item position, if using an Objective C app, but I'm not sure how to translate that to a Swift app. For example, one answer suggests using the following to get the frame of the status item after clicking on it:
[[[NSApp currentEvent] window] frame]
but, in Swift, NSApp.currentEvent does not have a member named "window"...
Does anyone know of any example MenuBar apps, written in Swift, that have more than just a simple list of menu items? Is such a thing simply not possible with Swift, yet?
UPDATE:
Since the examples and starter apps that do this kind of thing in Objective C are abundant, and there's little or nothing on how to do it in Swift, I ended up abandoning the Swift route and built an Objective C app, instead. I used this one as a starter: https://github.com/shpakovski/Popup. It was very quick/easy to get started and ended up being a lot less work than a Swift app would have been.
Maybe one day when Swift is more mature, I'll try another one in that language.