I am creating an OS X status bar application.
I am trying to achieve the following:
The makeKeyAndOrderFront
method is a NSWindow
method, but instantiateInitialController
returns the window controller, not its window.
Also, if the window is hidden on deactivate, you wouldn't want to instantiate another copy. Keep a reference to the window and re-show that.
Finally, you may need to bring the app to the front too. Call [NSApp activateIgnoringOtherApps:YES]
(or the Swift equivalent).