Posts

Post not yet marked as solved
4 Replies
0 Views
Post marked as solved
1 Replies
0 Views
after all i find solution. first AppDelegate implement NSWindowDelegate then catch you main window in applicationDidFinishLaunching, then point mainWindow.delegate = self     func applicationDidFinishLaunching(_ notification: Notification) {         mainWindow = NSApp.windows[0]         mainWindow!.delegate = self         setUpMacMenu()     func windowShouldClose(_ sender: NSWindow) -> Bool {         NSApp.hide(nil)         return false     }     }```