A general query that returns a snapshot of all the matching samples currently saved in the HealthKit store.
- iOS 8.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
The sample query returns sample objects that match the provided type and predicate. You can provide a sort order for the returned samples, or limit the number of samples returned. Other query classes can be used to perform more specialized searches and calculations. For more information, see
Sample queries are immutable: The query’s properties are set when the query is first created, and they can't change.