Structure

HKStatisticsOptions

Options for specifying the statistic to calculate.

Overview

You cannot combine a discrete option with a cumulative option. You can, however, combine multiple discrete options together to perform multiple calculations. You can also combine the `separateBySource` option with any of the other options.

Topics

Constants

`static var separateBySource: HKStatisticsOptions`

An option indicating that the system calculates the specified statistics separately for each source.

`static var discreteAverage: HKStatisticsOptions`

An option indicating that the system calculates the average quantity for the samples.

`static var discreteMin: HKStatisticsOptions`

An option indicating that the system calculates the minimum quantity for the samples.

`static var discreteMax: HKStatisticsOptions`

An option indicating that the system calculates the maximum quantity for the samples.

`static var cumulativeSum: HKStatisticsOptions`

An option indicating that the system calculates the sum of all the quantities for the samples.

`static var mostRecent: HKStatisticsOptions`

An option indicating that the system returns the most recent quantity from the matching samples.

`static var duration: HKStatisticsOptions`

An option indicating that the system calculates the total duration covering all the samples.

Deprecated Constants

`static var discreteMostRecent: HKStatisticsOptions`

An option indicating that the system returns the most recent quantity from the matching samples.

Deprecated

Initializers

`init(rawValue: UInt)`

Returns a newly initialized statistics option using the provided integer.

Relationships

Calculating Statistics

`class HKStatisticsQuery`

A query that performs statistical calculations over a set of matching quantity samples, and returns the results.

`class HKStatisticsCollectionQuery`

A query that performs multiple statistics queries over a series of fixed-length time intervals, and returns the results.

`class HKStatistics`

An object that represents the result of calculating the minimum, maximum, average, or sum over a set of samples from the HealthKit store.

`class HKStatisticsCollection`

An object that manages a collection of statistics; each statistics object represents the data calculated over a separate time interval.