Sample Code

Reading and Writing HealthKit Series Data

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



See Also

First Steps

Saving Data to HealthKit

Create and share HealthKit samples.

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.

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

Metadata Keys

Constants used to add metadata to objects stored in HealthKit.