CoachWatchApp: WKApplicationDelegateAdaptor active WCSession au boot, injecte les managers. ContentView: picker 4 activités (course/vélo/marche/renfo) -> vue live (FC/calories/distance/durée + état liaison iPhone) -> bouton Terminer. Build OK. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23 lines
588 B
Swift
23 lines
588 B
Swift
import SwiftUI
|
|
import WatchKit
|
|
|
|
@main
|
|
struct CoachWatchApp: App {
|
|
@WKApplicationDelegateAdaptor private var appDelegate: WatchAppDelegate
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
ContentView()
|
|
.environmentObject(WorkoutManager.shared)
|
|
.environmentObject(ConnectivityManager.shared)
|
|
}
|
|
}
|
|
}
|
|
|
|
final class WatchAppDelegate: NSObject, WKApplicationDelegate {
|
|
func applicationDidFinishLaunching() {
|
|
// Active WCSession dès le boot pour ne rater aucun early message.
|
|
_ = ConnectivityManager.shared
|
|
}
|
|
}
|