In my app users can do workouts and they get listed in my app. If a user wants to delete a workout inside my app, I'd like to offer him to also delete it from HealthKit. But I can't seem to find a way to fetch an HKObject
by it's uuid?!? Is that not possible? Cause creating a HKSampleQuery
and use uuid == <The-workout-UUID>
does not work. It will crash any say that this keypath (even though ever HKObject has an uuid) is not valid...
Asked
Active
Viewed 480 times
3

Sam Spencer
- 8,492
- 12
- 76
- 133

Georg
- 3,664
- 3
- 34
- 75
1 Answers
5
You can use the HKQuery
convenience method predicateForObjectWithUUID:
to match an object with a specific UUID (documentation here).

Allan
- 7,039
- 1
- 16
- 26
-
Awesome! Thanks! Somehow missed that one! – Georg Jun 03 '17 at 08:04