tokenary/Encrypted Ink/AppDelegate.swift

23 lines
610 B
Swift
Raw Normal View History

2021-06-12 13:48:29 +03:00
// Copyright © 2021 Encrypted Ink. All rights reserved.
2021-06-12 13:32:27 +03:00
import Cocoa
2021-06-12 18:22:02 +03:00
@NSApplicationMain
2021-06-12 13:32:27 +03:00
class AppDelegate: NSObject, NSApplicationDelegate {
2021-06-12 18:48:23 +03:00
2021-06-13 01:35:24 +03:00
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return false
}
2021-06-12 13:32:27 +03:00
func applicationDidFinishLaunching(_ aNotification: Notification) {
2021-06-13 06:30:20 +03:00
Agent.shared.start()
2021-06-12 13:32:27 +03:00
}
2021-06-12 21:15:32 +03:00
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
2021-06-13 06:30:20 +03:00
// TODO: make sure it is called only when icon tapped
Agent.shared.reopen()
2021-06-12 21:15:32 +03:00
return true
}
2021-06-12 18:48:23 +03:00
}