Type Method


Returns the shared HKDocumentType object for the provided identifier.


class func documentType(forIdentifier identifier: HKDocumentTypeIdentifier) -> HKDocumentType?



A document type identifier. For a list of valid identifiers, see HealthKit Constants.

Return Value

The shared HKDocumentType instance based on the provided identifier.


This method returns an instance of the HKQuantityType concrete subclass. HealthKit uses document types to manage medical documents. Use document type instances to create document samples that you can save in the HealthKit store. For more information, see HKDocumentSample.

See Also

Creating Subclasses

class func categoryType(forIdentifier: HKCategoryTypeIdentifier)

Returns the shared HKCategoryType object for the provided identifier.

class func characteristicType(forIdentifier: HKCharacteristicTypeIdentifier)

Returns the shared HKCharacteristicType object for the provided identifier.

class func quantityType(forIdentifier: HKQuantityTypeIdentifier)

Returns the shared HKQuantityType object for the provided identifier.

class func workoutType()

Returns the shared HKWorkoutType object.