secretive/Secretive/AppDelegate.swift

34 lines
950 B
Swift
Raw Normal View History

2020-02-19 03:36:41 +00:00
import Cocoa
import SwiftUI
2020-02-19 04:52:00 +00:00
import SecretKit
2020-02-19 03:36:41 +00:00
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
2020-02-19 04:52:00 +00:00
let secureEnclave = SecureEnclave.Store()
let contentView = ContentView(store: secureEnclave)
// Create the window and set the content view.
2020-02-19 03:36:41 +00:00
window = NSWindow(
contentRect: NSRect(x: 0, y: 0, width: 480, height: 300),
styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
backing: .buffered, defer: false)
window.center()
window.setFrameAutosaveName("Main Window")
window.contentView = NSHostingView(rootView: contentView)
window.makeKeyAndOrderFront(nil)
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
}