mirror of
https://github.com/seemoo-lab/openhaystack.git
synced 2026-02-14 09:39:52 +00:00
43 lines
1.2 KiB
Swift
43 lines
1.2 KiB
Swift
//
|
||
// OpenHaystack – Tracking personal Bluetooth devices via Apple's Find My network
|
||
//
|
||
// Copyright © 2021 Secure Mobile Networking Lab (SEEMOO)
|
||
// Copyright © 2021 The Open Wireless Link Project
|
||
//
|
||
// SPDX-License-Identifier: AGPL-3.0-only
|
||
//
|
||
|
||
import Cocoa
|
||
import SwiftUI
|
||
|
||
@main
|
||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||
|
||
var window: NSWindow!
|
||
|
||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||
// Create the SwiftUI view that provides the window contents.
|
||
let contentView = OFFetchReportsMainView()
|
||
|
||
// Create the window and set the content view.
|
||
window = NSWindow(
|
||
contentRect: NSRect(x: 0, y: 0, width: 480, height: 300),
|
||
styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
|
||
backing: .buffered, defer: false)
|
||
window.isReleasedWhenClosed = 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
|
||
}
|
||
|
||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||
return true
|
||
}
|
||
|
||
}
|