tokenary/Encrypted Ink/AppDelegate.swift
2021-06-19 21:20:42 +03:00

30 lines
884 B
Swift

// Copyright © 2021 Encrypted Ink. All rights reserved.
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return false
}
func applicationDidFinishLaunching(_ aNotification: Notification) {
Agent.shared.start()
Agent.shared.setupStatusBarItem()
}
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
Agent.shared.reopen()
return true
}
func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([NSUserActivityRestoring]) -> Void) -> Bool {
if let url = userActivity.webpageURL?.absoluteString {
print(url)
}
return true
}
}