diff --git a/macOS/AppDelegate.swift b/macOS/AppDelegate.swift index a9ab893..c827427 100644 --- a/macOS/AppDelegate.swift +++ b/macOS/AppDelegate.swift @@ -1,12 +1,22 @@ import AppKit class AppDelegate: NSObject, NSApplicationDelegate { + func applicationDidFinishLaunching(_ notification: Notification) { + NSApplication.shared.delegate = self + } + func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { + print(#function, "flag -> \(flag)") if !flag { for window: AnyObject in sender.windows { window.makeKeyAndOrderFront(self) } } return true } + + func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool { + print(#function) + return true + } }