The HKDocument
class is an abstract class that represents a health document in the HealthKit store.
SDKs
- iOS 10.0+
- Mac Catalyst 13.0+
- watchOS 3.0+
Framework
- Health
Kit
Declaration
@interface HKDocumentSample : HKSample
Overview
You should never instantiate an HKDocument
object directly. Instead, you always work with a concrete subclass. In iOS 10 and watchOS 3, the only concrete class is the HKCDADocument
class.
Document samples are immutable: You set the sample’s properties when you create it, and they cannot change.
Subclassing Notes
Like many HealthKit classes, you should not create any custom subclasses of the HKDocument
class. You can extend the HKDocument
class and its subclasses by adding custom metadata keys and values to the metadata dictionary when the object is instantiated.