A long-running query that monitors the HealthKit store and updates your app when the HealthKit store saves or deletes a matching sample.
- iOS 8.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
Observer queries set up a long-running task on a background queue. This task watches the HealthKit store, and alerts you when the store saves or removes matching data. Your app uses observer queries to respond to changes made by other apps and devices.
Observer queries are immutable: You set their properties when you first create them, and you can’t change them.