Instance Method

execute(_:)

Starts executing the provided query.

Declaration

func execute(_ query: HKQuery)

Parameters

query

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.

See Also

Querying HealthKit Data

func stop(HKQuery)

Stops a long-running query.