diff options
| author | Dustin Mierau <dustin@mierau.me> | 2023-12-19 20:38:13 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2023-12-19 20:38:13 -0800 |
| commit | 4fd69c02a3e7b581bb9229865336c315153f3b18 (patch) | |
| tree | e6e11d872424196f2b4033077902126ad5556e40 /Hotline/Application.swift | |
| parent | 5e87b5927cd931d46fb5f72fb035480a95969a9f (diff) | |
Beginnings of a UI for macOS as well as some visual changes to iOS client. :)
Diffstat (limited to 'Hotline/Application.swift')
| -rw-r--r-- | Hotline/Application.swift | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Hotline/Application.swift b/Hotline/Application.swift new file mode 100644 index 0000000..2b25ba5 --- /dev/null +++ b/Hotline/Application.swift @@ -0,0 +1,34 @@ +import SwiftUI +import SwiftData + +@main +struct Application: App { + @State private var appState = HotlineState() + + #if os(iOS) + private var model = Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient()) + #endif + + var body: some Scene { + #if os(iOS) + WindowGroup { + TrackerView() + .environment(appState) + .environment(model) + } + #elseif os(macOS) + WindowGroup { + TrackerView() + } + WindowGroup(for: Server.self) { $server in + if let s = server { + ServerView(server: s) + .frame(minWidth: 400, minHeight: 300) + .environment(Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient())) + } + } + .defaultSize(width: 700, height: 800) + + #endif + } +} |