execute(_:)
Starts executing the provided query.
Declaration
func execute(_ query: HKQuery)Parameters
- query:
A concrete subclass of the Hkquery class (any of the classes Hksamplequery, Hkanchoredobjectquery, Hkcorrelationquery, Hkobserverquery, Hksourcequery, Hkstatisticsquery, or Hkstatisticscollectionquery).
Mentioned in
Discussion
HealthKit executes queries asynchronously on a background queue. Most queries automatically stop after they have finished executing. However, long-running queries—such as observer queries and some statistics collection queries—continue to execute in the background. To stop long-running queries, call the stop(_:) method.