<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkoutRouteBuilder/insertRouteData(_:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKWorkoutRouteBuilder(im)insertRouteData:completion:"
  },
  "title" : "insertRouteData(_:completion:)"
}
-->

# insertRouteData(_:completion:)

Adds route data to the builder.

```
func insertRouteData(_ routeData: [CLLocation], completion: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

```
func insertRouteData(_ routeData: [CLLocation]) async throws
```

## Parameters

`routeData`

An array containing one or more location objects.

`completion`

A block called after the system adds the collection data to the builder. The system passes the block the following parameters:

- `success`: A Boolean value that indicates whether the  builder successfully received the route data.
- `error`: An object that describes the error, if an error has occurred; otherwise, `nil`.

## Discussion

Use this method to asynchronously add one or more <doc://com.apple.documentation/documentation/CoreLocation/CLLocation> objects to the series. The <doc://com.apple.documentation/documentation/CoreLocation/CLLocation> objects may be inserted in any order; the builder sorts them by date when finalizing the route.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)