---
title: "init(route:dataHandler:)"
framework: healthkit
role: symbol
role_heading: Initializer
path: "healthkit/hkworkoutroutequery/init(route:datahandler:)"
---

# init(route:dataHandler:)

Creates a new query to access the location data associated with a workout route.

## Declaration

```swift
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:

## Return Value

Return Value A newly initialized route query.

## See Also

### Creating route queries

- [init(route:dateInterval:dataHandler:)](healthkit/hkworkoutroutequery/init(route:dateinterval:datahandler:).md)
