watchOS notification screen

This commit is contained in:
2025-10-29 22:13:29 +08:00
parent fcbd5fe680
commit 82682cae9a
6 changed files with 342 additions and 7 deletions

View File

@@ -9,7 +9,32 @@ import SwiftUI
// The root view of the app.
struct ContentView: View {
var body: some View {
ExploreView()
@StateObject private var appState = AppState()
@State private var selection: Panel? = .explore
enum Panel: Hashable {
case explore
case notifications
}
}
var body: some View {
NavigationSplitView {
List(selection: $selection) {
Label("Explore", systemImage: "globe").tag(Panel.explore)
Label("Notifications", systemImage: "bell").tag(Panel.notifications)
}
.listStyle(.automatic)
} detail: {
switch selection {
case .explore:
ExploreView()
.environmentObject(appState)
case .notifications:
NotificationView()
.environmentObject(appState)
case .none:
Text("Select a panel")
}
}
}
}