HKStatisticsCollectionQuery
A query that performs multiple statistics queries over a series of fixed-length time intervals.
Declaration
class HKStatisticsCollectionQueryMentioned in
Overview
Statistics collection queries are often used to produce data for graphs and charts. For example, you might create a statistics collection query that calculates the total number of steps for each day or the average heart rate for each hour. Like observer queries, collection queries can also act as long-running queries, receiving updates when the HealthKit store’s content changes.
Statistics collection queries are mostly immutable. You can assign the query’s initialResultsHandler and statisticsUpdateHandler properties after instantiating the object. You must set all other properties when you instantiate the object, and they can’t change.
For more information about statistics queries, see HKStatisticsQuery.
Topics
Creating Statistics Collection Objects
Executing Statistics Collection Queriesinit(quantityType:quantitySamplePredicate:options:anchorDate:intervalComponents:)