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

37 lines
935 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()
2023-08-14 10:39:29 +02:00
let history = HistoryManager()
@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)
2023-08-14 10:39:29 +02:00
.environmentObject(history)
.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-14 10:39:29 +02:00
HistoryView(history: history)
.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
}
}
}