init(route:dataHandler:)
Creates a new query to access the location data associated with a workout route.
Declaration
init(route workoutRoute: HKWorkoutRoute, dataHandler: @escaping @Sendable (HKWorkoutRouteQuery, [CLLocation]?, Bool, (any Error)?) -> Void)Parameters
- workoutRoute:
The workout route containing the location data.
- dataHandler:
A block called each time the system returns a batch of location data. This block may be called one or more times.
The block is passed the following parameters:
queryThe query that returns the location data.
routeDataA batch of location data, or
nilif an error has occurred.doneA Boolean value that indicates whether the query is complete. It is True if all the location data has been returned. If one or more additional batches of data are still pending, it is False.
errorAn object that describes the error, if an error has occurred; otherwise,
nil.
Return Value
A newly initialized route query.