Reputation: 181
Is there anyway to add an array of HKWorkouts to UserDefaults or do I have to save the array in core data?
Upvotes: 0
Views: 64
Reputation: 7363
HKObject
and its subclasses conform to NSSecureCoding
, so you can convert an array of them to Data
using NSKeyedArchiver
. See the NSKeyedArchiver documentation for more details.
Upvotes: 1