A query for read activity summary objects from the HealthKit store.
Mac Catalyst 13.0+Beta
Activity summary query objects are mostly immutable. You can assign the query’s updateHandler property after instantiating the object. All other properties must be set when you instantiate the object, and they cannot change.
Executing Activity Summary Queries
The sample code, shown below, builds and executes a query that returns the activity summaries for the previous week.
This code performs the following steps:
Creates the date component objects representing the start and end days, as perceived by the user.
Creates a predicate object using the date components.
A view that uses the Move, Exercise, and Stand activity rings to display data from a HealthKit activity summary object.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.