From 4fd69c02a3e7b581bb9229865336c315153f3b18 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Tue, 19 Dec 2023 20:38:13 -0800 Subject: Beginnings of a UI for macOS as well as some visual changes to iOS client. :) --- Hotline/Application.swift | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Hotline/Application.swift (limited to 'Hotline/Application.swift') 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 + } +} -- cgit