I have an app working from an extension in the Status Menu.
I have there a button "Settings" on which when the user taps should launch a particular view of my storyboard.
I have tried many different ways, Open NSWindowController from NSMenu, Cocoa - How to bring particular window to come in foreground from StatusMenu.
Here is my current code :
StatusMenu.swift
func showSettings() {
var mainWindowController = MainWindowController()
mainWindowController.showWindow(nil)
}
MainWindowController.swift
class MainWindowController: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()
self.window?.center()
self.window?.makeKeyAndOrderFront(nil)
NSApp.activate(ignoringOtherApps: true)
}
}