<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKDirections/DirectionsHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:@T@MKDirectionsHandler"
  },
  "title" : "MKDirections.DirectionsHandler"
}
-->

# MKDirections.DirectionsHandler

The block to use for processing the requested route information.

```
typealias DirectionsHandler = (MKDirections.Response?, (any Error)?) -> Void
```

## Parameters

`response`

The `response` parameter contains the route information for the request. If an error occurs or the framework can’t determine a route, this parameter is `nil`.

`error`

The `error` parameter contains information about any errors that occur. If no errors occur, this parameter is `nil`.

## Discussion

The implementation of your block needs to check for a value in the `error` parameter and, if that parameter is `nil`, incorporate the route information from the `response` parameter.

---

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)