import SwiftUI /// Camper Monitor am Handgelenk. /// /// Die Uhr ist Anzeige und Fernbedienung; gefunkt wird über das iPhone. Was /// hier steht, kam von dort – deshalb steht auf jedem Bildschirm auch, wie alt /// es ist. @main struct CamperWatchApp: App { @State private var link = PhoneLink() @Environment(\.scenePhase) private var scenePhase var body: some Scene { WindowGroup { WatchRootView() .environment(link) .task { link.activate() } } .onChange(of: scenePhase) { _, phase in // Der schnelle Takt kostet auf beiden Seiten Strom und lohnt nur, // solange jemand hinschaut. Genau das sagt die Bildschirmphase aus: // im Vordergrund schaut jemand hin, sonst nicht. link.setLive(phase == .active) } } }