Files
iKeyMon/Sources/iKeyMonApp.swift
2025-11-25 16:21:07 +01:00

42 lines
828 B
Swift

//
// iKeyMonApp.swift
// iKeyMon
//
// Created by tracer on 30.03.25.
//
import SwiftUI
#if os(macOS)
import AppKit
#endif
@main
struct iKeyMonApp: App {
@StateObject private var sparkleUpdater = SparkleUpdater()
init() {
#if os(macOS)
if let customIcon = NSImage(named: "AppIcon") {
NSApplication.shared.applicationIconImage = customIcon
}
#endif
}
var body: some Scene {
WindowGroup {
MainView()
.environmentObject(sparkleUpdater)
.onDisappear {
NSApp.terminate(nil)
}
}
.windowResizability(.contentMinSize)
Settings {
PreferencesView()
.padding()
.environmentObject(sparkleUpdater)
}
}
}