A piece of data that can be stored inside the HealthKit store.
- iOS 8.0+
- watchOS 2.0+
HKObject class is an abstract class. You should never instantiate a
HKObject object directly. Instead, always work with one of its concrete subclasses:
HealthKit objects are all immutable. With a few exceptions (such as the object’s source revision), the object’s properties are set when the object is first created and they cannot change.
Like many HealthKit classes, the
HKObject class should not be subclassed. You can extend
HKObject and its subclasses by adding custom metadata keys and values to the metadata dictionary when the object is created.