At the moment I am working on a running app for the iPhone.
One issue that I have is, that I am building the HKWorkout using the HKWorkoutBuilder according to Apples Documentation.
But I am not able to associate the totalDistance with the workout – mentioned here in the Documentation. totalDistance is nil when I try to read it from the workout – no surprise.
Probably better to ask over at the Apple-specific developer sites like Apple Developer Forum (HealthKit group). This is about specific Apple frameworks and environments which are not really the subject of these forums.