Instance Method

stop(_:)

Stops a long-running query.

Declaration

func stop(_ query: HKQuery)

Parameters

query

Either an HKObserverQuery instance or an HKStatisticsCollectionQuery instance.

Discussion

Use this method on long-running queries only. Most queries automatically stop after they have gathered the requested data. Long-running queries continue to operate on a background thread, watching the HealthKit store for updates. You can cancel these queries by using this method.

See Also

Querying HealthKit Data

func execute(HKQuery)

Starts executing the provided query.