Type Method


Returns the shared HKCorrelationType object for the provided identifier.


class func correlationType(forIdentifier identifier: HKCorrelationTypeIdentifier) -> HKCorrelationType?



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

Return Value

The shared HKCorrelationType instance based on the provided identifier.


This method returns an instance of the HKCorrelationType concrete subclass. HealthKit uses correlation types to create complex data objects that contain multiple values. Use correlation type instances to create correlation objects that you can save in the HealthKit store. For more information, see HKCorrelation.

HealthKit provides two correlation type identifiers: bloodPressure and food.

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 documentType(forIdentifier: HKDocumentTypeIdentifier)

Returns the shared HKDocumentType 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.