Contents

quantityType(forIdentifier:)

Returns the shared quantity type for the provided identifier.

Declaration

class func quantityType(forIdentifier identifier: HKQuantityTypeIdentifier) -> HKQuantityType?

Parameters

Mentioned in

Return Value

The shared HKQuantityType instance based on the provided identifier.

Discussion

This method returns an instance of the HKQuantityType concrete subclass. HealthKit uses quantity types to create samples that store a numerical value. Use quantity type instances to create quantity samples that you can save in the HealthKit store. For more information, see HKQuantitySample.

See Also

Creating quantity types