42 lines
832 B
Swift
42 lines
832 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 updateViewModel = UpdateViewModel()
|
|
|
|
init() {
|
|
#if os(macOS)
|
|
if let customIcon = NSImage(named: "AppIcon") {
|
|
NSApplication.shared.applicationIconImage = customIcon
|
|
}
|
|
#endif
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
MainView()
|
|
.environmentObject(updateViewModel)
|
|
.onDisappear {
|
|
NSApp.terminate(nil)
|
|
}
|
|
}
|
|
.windowResizability(.contentMinSize)
|
|
|
|
Settings {
|
|
PreferencesView()
|
|
.padding()
|
|
.environmentObject(updateViewModel)
|
|
}
|
|
}
|
|
}
|