<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPBarButton/init(image:handler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPBarButton(im)initWithImage:handler:"
  },
  "title" : "init(image:handler:)"
}
-->

# init(image:handler:)

Creates a bar button that displays an image.

```
init(image: UIImage, handler: CPBarButtonHandler? = nil)
```

## Parameters

`image`

The image to display on the button.

`handler`

The block that CarPlay invokes when the user taps the button.

## Return Value

A bar button that displays the provided image.

---

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)