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