A builder object that incrementally constructs a workout route.
- iOS 11.0+
- watchOS 4.0+
HKWorkout to create a route and associate it with a workout. First, you must request three types of permission, including authorization to:
Read and share
Use location services (see
To create a workout route, start by creating a new workout route builder:
As your app receives location data, filter the data and call
insert to add it to the builder. Do not insert any location data whose accuracy is greater than 50 meters. Apps that read the data may also perform additional smoothing before using the data.
After the workout is finished, save the workout. Then call
finish to create the route data and associate it with the workout.