Instance Method

durationForSource:

Returns the total duration covering all the samples created by the specified source that also match the query.

Declaration

- (HKQuantity *)durationForSource:(HKSource *)source;

Discussion

If you set both the HKStatisticsOptionDuration and HKStatisticsOptionSeparateBySource options, this method returns a quantity object. This object contains the total duration covering all the samples created by the specified source that also match the query. If the statistics options were not both set, this method returns nil.

See Also

Getting Statistics Data

- averageQuantity

Returns the average value from all the samples that match the query.

- averageQuantityForSource:

Returns the average value from all the samples that match the query and that were created by the specified source.

- maximumQuantity

Returns the maximum value from all the samples that match the query.

- maximumQuantityForSource:

Returns the maximum value from all the samples that match the query and that were created by the specified source.

- minimumQuantity

Returns the minimum value from all the samples that match the query.

- minimumQuantityForSource:

Returns the minimum value from all the samples that match the query and that were created by the specified source.

- sumQuantity

Returns the sum of all the samples that match the query.

- sumQuantityForSource:

Returns the sum of all the samples that match the query and that were created by the specified source.

- duration

Returns the total duration covering all the samples that match the query.