Instance Method

maximumQuantityForSource:

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

Declaration

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

Parameters

source

A data source from the statistics object’s sources array.

Return Value

If both the HKStatisticsOptionDiscreteMax option and the HKStatisticsOptionSeparateBySource option were set, this method returns a quantity object. This object contains the maximum value from all the samples that match the query and were created by the specified source. 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.

- 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.

- durationForSource:

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