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.

class HKQuantity

An object that stores a value for a given unit.

class HKUnit

A class for managing the units of measure within HealthKit.

enum 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.

Reading and Writing HealthKit Series Data

Share and read heartbeat and quantity series data using series builders and queries.

class HKCumulativeQuantitySample

A sample that represents a cumulative quantity.

class HKDiscreteQuantitySample

A sample that represents a discrete quantity.

class HKQuantitySample

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

class HKCategorySample

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

class HKCorrelation

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

Metadata Keys

Constants used to add metadata to objects stored in HealthKit.