The HKDocumentSample class is an abstract class that represents a health document in the HealthKit store.


You should never instantiate an HKDocumentSample object directly. Instead, you always work with a concrete subclass. In iOS 10 and watchOS 3, the only concrete class is the HKCDADocumentSample 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 HKDocumentSample class. You can extend the HKDocumentSample class and its subclasses by adding custom metadata keys and values to the metadata dictionary when the object is instantiated.


Accessing the Document Sample Properties

var documentType: HKDocumentType

The type of document represented by the sample.


Inherits From

Conforms To