Contents

HKCorrelationType

A type that identifies samples that group multiple subsamples.

Declaration

class HKCorrelationType

Overview

The HKCorrelationType class is a concrete subclass of the HKObjectType class. To create a correlation type instance, use the object type’s correlationType(forIdentifier:) conveniance method.

Use correlation types to:

  • Request permission to read or write matching quantity samples.

  • Create and share matching quantity samples.

  • Query for matching quantity samples.

HealthKit provides two correlation types: blood pressure and food.

Using Correlation Types

Like many HealthKit classes, correlation types are not extensible and should not be subclassed.

This class reuses the same instance whenever possible. Letting multiple queries share the same workout type helps reduce the overall memory usage.

Topics

Creating Correlation Types

See Also

Related Documentation

Object type subclasses