quantityType(forIdentifier:)
Returns the shared quantity type for the provided identifier.
Declaration
class func quantityType(forIdentifier identifier: HKQuantityTypeIdentifier) -> HKQuantityType?Parameters
- identifier:
A quantity type identifier. For a list of valid identifiers, see Hkquantitytypeidentifier.
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.