<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPContactDirectionsButton",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPContactDirectionsButton"
  },
  "title" : "CPContactDirectionsButton"
}
-->

# CPContactDirectionsButton

A button for getting directions to the contact’s location.

```
class CPContactDirectionsButton
```

## Overview

Use this button to get directions to the location of the template’s contact.

If your app doesn’t provide turn-by-turn navigation, use the `maps` URL scheme to launch the most recent navigation app. Call your template application scene’s <doc://com.apple.documentation/documentation/UIKit/UIScene/open(_:options:completionHandler:)> method and pass a URL that embeds the contact’s location. CarPlay provides this scene to your [`CPTemplateApplicationSceneDelegate`](/documentation/CarPlay/CPTemplateApplicationSceneDelegate) when the scene connects.

## Topics

### Creating a Contact Directions Button

[`init(handler: ((CPButton) -> Void)?)`](/documentation/CarPlay/CPContactDirectionsButton/init(handler:))

Creates a button that invokes a handler when the user taps it.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`CPButton`](/documentation/CarPlay/CPButton)

---

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)