Class

HKStatisticsCollection

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

Declaration

@interface HKStatisticsCollection : NSObject

Overview

For more information on statistics objects, see HKStatistics. For more information on calculating statistics over consecutive time intervals, see HKStatisticsCollectionQuery.

Topics

Accessing Statistics Collections

- statistics

Returns an array of statistics objects representing the populated time intervals covered by the statistics collection query.

- statisticsForDate:

Returns the statistics object for the time interval that contains the provided date.

- enumerateStatisticsFromDate:toDate:withBlock:

Enumerates the statistics objects for all the time intervals from the start date until the end date.

Getting Information About Statistics Collections

- sources

Returns a set containing all the sources that had samples matched by the statistics collection query.

Relationships

Inherits From

See Also

Calculating Statistics

HKStatisticsQuery

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

HKStatisticsCollectionQuery

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

HKStatistics

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

HKStatisticsOptions

Options for specifying the statistic to calculate.