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


enum HKQuantityAggregationStyle : Int


A quantity type’s aggregation style determines the type of statistics queries that you can perform. Discrete types support average, minimum, and maximum queries. Cumulative types support only sum queries. For more information, see HKStatisticsQuery.


Aggregation Styles

case cumulative

Cumulative samples that can be summed over time.

case discreteArithmetic

Discrete samples that can be averaged over time using an arithmetic mean.

case discreteTemporallyWeighted

Discrete samples that can be averaged over a time interval using a temporally weighted integration function.

case discreteEquivalentContinuousLevel

Discrete samples that can be combined over a time interval by computing the equivalent continuous sound level.

Deprecated Styles

static var discrete: HKQuantityAggregationStyle

Discrete samples may be averaged over time.


See Also

Accessing Quantity Type Data

var aggregationStyle: HKQuantityAggregationStyle

The aggregation style for the given quantity type.

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

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