瀏覽代碼

Quit application after last window closed

master
Matt Baer 6 年之前
父節點
當前提交
c2185d3c9f
共有 1 個檔案被更改,包括 5 行新增1 行删除
  1. +5
    -1
      writeas/AppDelegate.swift

+ 5
- 1
writeas/AppDelegate.swift 查看文件

@@ -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


Loading…
取消
儲存