Class

HKQuantityType

A type that identifies samples that store numerical values.

Declaration

class HKQuantityType : HKSampleType

Overview

The HKQuantityType class is a concrete subclass of the HKObjectType class. To create a quantity type instance, use the object type’s quantityType(forIdentifier:) convenience method.

Use quantity types to:

  • Request permission to read or write matching quantity samples.

  • Create and share matching quantity samples.

  • Query for matching quantity samples.

Topics

Accessing Quantity Type Data

var aggregationStyle: HKQuantityAggregationStyle

The aggregation style for the given quantity type.

enum HKQuantityAggregationStyle

Constant values that describe how quantities can be aggregated over time.

func `is`(compatibleWith: HKUnit) -> Bool

Returns a Boolean value that indicates whether the quantity type is compatible with the given unit.

Relationships

Inherits From

Conforms To

See Also

Type Objects

class HKCharacteristicType

A type that represents data that does not typically change over time.

class HKCategoryType

A type that identifies samples that contain a value from a small set of possible values.

class HKCorrelationType

A type that identifies samples that group multiple subsamples.

class HKActivitySummaryType

A type that identifies activity summary objects.

class HKAudiogramSampleType

A type that identifies samples that contain audiogram data.

Beta
class HKSeriesType

A type that indicates the data stored in a series sample.

class HKObjectType

The abstract superclass for all classes that identify a specific type of data when working with the HealthKit store.

class HKSampleType

An abstract superclass for all classes that identify a specific type of sample when working with the HealthKit store.

class HKClinicalType

A type that identifies samples that contain clinical record data.

class HKWorkoutType

A type that identifies samples that store information about a workout.