HKWorkoutSession - pause / resume

Apple's Workout app has pause / resume buttons. I don't see any API calls on HKHealthStore that corresponds to these functions thus I guess they simply stop collecting samples coming from streaming HKQuery while it's paused.


What I'm interested in is: how to later on fetch that same workout from HealthKit and how to recognize when the pause/continue happened? If I record a workout with the watch, I want to later on be able to pick it up on my iOS app and then display a chart of pace vs HR vs distance and mark each pause when it happened.


I want to avoid having to maintain a separate log of workouts and timestamps just for this, since I can get everything else I need from HealthKit.

Accepted Reply

Hah, found it!

You collect these events as HKWorkoutEvent objects and then saved them along with the workout. Awesome.

Replies

Hah, found it!

You collect these events as HKWorkoutEvent objects and then saved them along with the workout. Awesome.