Sesame-iOS/Sesame-Watch Watch App/Sesame_WatchApp.swift
2023-08-14 10:39:29 +02:00

37 lines
935 B
Swift

import SwiftUI
@main
struct Sesame_Watch_Watch_AppApp: App {
let keyManagement = KeyManagement()
let history = HistoryManager()
@State
var selected: Int = 0
@State
var didLaunchFromComplication = false
var body: some Scene {
WindowGroup {
TabView(selection: $selected) {
ContentView(didLaunchFromComplication: $didLaunchFromComplication)
.environmentObject(keyManagement)
.environmentObject(history)
.tag(1)
SettingsView()
.environmentObject(keyManagement)
.tag(2)
HistoryView(history: history)
.tag(3)
}
.tabViewStyle(PageTabViewStyle())
.onOpenURL { url in
selected = 0
didLaunchFromComplication = true
}
}
}
}