Просмотр исходного кода

Quit application after last window closed

master
Matt Baer 6 лет назад
Родитель
Сommit
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


Загрузка…
Отмена
Сохранить