Post

Replies

Boosts

Views

Activity

Issue with workoutPreview API - Workouts Not Sending to Apple Watch
Hi everyone, I’m reaching out to see if anyone else has experienced issues with the workoutPreview API. I’ve been trying to get it to send workouts to the Apple Watch, but it’s not working as expected. Even the example code provided in the official documentation fails to do the job. For reference, I’m using the latest stable (non-beta) versions of iOS and watchOS. import SwiftUI import WorkoutKit struct PresentPreviewDemo: View { private let cyclingWorkoutPlan: WorkoutPlan @State var showPreview: Bool = false init() { cyclingWorkoutPlan = WorkoutPlan(.custom(WorkoutStore.createCyclingCustomWorkout())) } var body: some View { Button("Present Cycling Workout Preview") { showPreview.toggle() } .workoutPreview(cyclingWorkoutPlan, isPresented: $showPreview) } } struct PresentPreviewDemo_Previews: PreviewProvider { static var previews: some View { PresentPreviewDemo() } } It used to work but it is not working anymore. Has anyone else run into this problem? Is there a known issue or workaround that I might have missed? I’ve tried everything I can think of, and this is blocking my progress. Any insights or suggestions would be greatly appreciated! Thanks in advance!
2
0
277
Sep ’24