HKLiveWorkoutBuilder, HKWorkoutRouteBuilder and Workout Distance

I am using `HKLiveWorkoutBuilder` & `HKWorkoutRouteBuilder` to track a workout on Apple Watch.


when calling:


[workoutBuilder finishWorkoutWithCompletion:^(HKWorkout * _Nullable workout, NSError * _Nullable error) {


}];


The returned workout object does not include the distance that the user travelled:


(lldb) po workout.totalDistance
nil


However the route is saved correctly.


Given that `.totalDistance` is read only, how should I set the distance of the workout in watchOS 5?


https://www.dropbox.com/s/yml1npdlh0jcow8/9LgSA.jpg?dl=0

https://www.dropbox.com/s/r7t03xqswkwqj6z/xnTG0.jpg?dl=0

Replies

did you fix this somehow?