HealthKit uses quantity objects to store numerical data. Quantities store a value for a given unit. You can request the value in any compatible units. For example, if you can create a length property in feet, you can then request the value in meters. The quantity object automatically converts its value to the requested units, as needed.
- iOS 8.0+
- watchOS 2.0+
Quantities are immutable objects: Their values are set when the object is first created and cannot change.
Like many HealthKit classes, the
HKQuantity class is not extendible and should not be subclassed. To help promote sharing data between apps,
HKQuantity objects use only the units defined by the