Quit application after last window closed

This commit is contained in:
Matt Baer 2017-08-03 18:07:59 -04:00
parent 5881a28110
commit c2185d3c9f

View File

@ -42,7 +42,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationWillTerminate(_ aNotification: Notification) {
vc?.saveDocument()
}
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
func applicationDidBecomeActive(_ notification: Notification) {
if vc == nil {
vc = NSApplication.shared().mainWindow?.contentViewController as? ViewController