GarySabo
GarySabo

Reputation: 6710

Is it possible to add metadata to an HKWorkout after it's already been saved?

Can I read out an HKworkout and add my own metadata to it, then resave it? If so how? Or can I only pass in metadata when I'm saving the workout?

Upvotes: 4

Views: 356

Answers (1)

Allan
Allan

Reputation: 7363

All HKObjects are immutable (the cannot be edited once saved). The recommend approach to editing an HKObject is to save a new copy with the changes you want to make and to delete the previous copy. You can only do this if your app created the original object, though.

Upvotes: 5

Related Questions