characteristicType(forIdentifier:)
Returns the shared characteristic type for the provided identifier.
Declaration
class func characteristicType(forIdentifier identifier: HKCharacteristicTypeIdentifier) -> HKCharacteristicType?Parameters
- identifier:
A characteristic type identifier. For a list of valid identifiers, see Hkcharacteristictypeidentifier.
Return Value
The shared HKCharacteristicType instance based on the provided identifier.
Discussion
This method returns an instance of the HKCharacteristicType concrete subclass. Characteristic types represent data that doesn’t typically change over time. Unlike the other object types, characteristic types cannot be used to create new HealthKit objects. Instead, users must enter and edit their characteristic data using the Health app. Characteristic types are used only when asking for permission to read data from the HealthKit store.