Sesame-iOS/Sesame-Watch Watch App/Sesame_WatchApp.swift

34 lines
860 B
Swift
Raw Normal View History

2023-08-07 15:57:09 +02:00
import SwiftUI
@main
struct Sesame_Watch_Watch_AppApp: App {
let keyManagement = KeyManagement()
@State
var selected: Int = 0
@State
var didLaunchFromComplication = false
2023-08-07 15:57:09 +02:00
var body: some Scene {
WindowGroup {
TabView(selection: $selected) {
ContentView(didLaunchFromComplication: $didLaunchFromComplication)
2023-08-07 15:57:09 +02:00
.environmentObject(keyManagement)
.tag(1)
2023-08-07 15:57:09 +02:00
SettingsView()
2023-08-09 16:29:18 +02:00
.environmentObject(keyManagement)
.tag(2)
2023-08-09 16:29:18 +02:00
HistoryView(history: HistoryManager())
.tag(3)
2023-08-07 15:57:09 +02:00
}
.tabViewStyle(PageTabViewStyle())
.onOpenURL { url in
selected = 0
didLaunchFromComplication = true
}
2023-08-07 15:57:09 +02:00
}
}
}