Units and Quantities

Objects used to specify a quantity for a given unit (for example, 175 lbs), and to convert between units (79.4 kg).

Topics

Units and Quantities

Defining and Converting Units and Quantities

Create and convert units and quantities.

HKQuantity

An object that stores a value for a given unit.

HKUnit

A class for managing the units of measure within HealthKit.

HKMetricPrefix

Prefixes that can be added to SI units to change the order of magnitude.

See Also

First Steps

Saving Data to HealthKit

Create and share HealthKit samples.

HKCumulativeQuantitySample

A sample that represents a cumulative quantity.

HKDiscreteQuantitySample

A sample that represents a discrete quantity.

HKQuantitySample

A sample that represents a quantity, including the value and the units.

HKCategorySample

A sample whose values are selected from a short list of possible values.

HKCorrelation

A sample that groups multiple related samples into a single entry.

Metadata Keys

Constants used to add metadata to objects stored in HealthKit.