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

# CPNowPlayingImageButton

A button that displays an image.

```
@MainActor class CPNowPlayingImageButton
```

## Overview

`CPNowPlayingImageButton` is a concrete subclass of [`CPNowPlayingButton`](/documentation/CarPlay/CPNowPlayingButton). Use this class when you want to display a button that contains an image.

In iOS 17 and later, CarPlay retints the custom now playing image buttons your app provides; you need to provide images  as monocolor assets.

CarPlay doesn’t support animated images. If you provide an animated image, CarPlay uses only the first image in the animation sequence.

To properly size your image, use the display scale of the vehicle’s primary screen—see your interface controller’s [`carTraitCollection`](/documentation/CarPlay/CPInterfaceController/carTraitCollection) property—and make sure it is no larger than [`CPNowPlayingButtonMaximumImageSize`](/documentation/CarPlay/CPNowPlayingButtonMaximumImageSize).

## Topics

### Creating a Button

[`init(image: UIImage, handler: ((CPNowPlayingButton) -> Void)?)`](/documentation/CarPlay/CPNowPlayingImageButton/init(image:handler:))

Creates a Now Playing button that displays a custom image and invokes a handler.

[`let CPNowPlayingButtonMaximumImageSize: CGSize`](/documentation/CarPlay/CPNowPlayingButtonMaximumImageSize)

The maximum size CarPlay supports for a button’s image.

### Getting the Button’s Image

[`var image: UIImage?`](/documentation/CarPlay/CPNowPlayingImageButton/image)

The image that the button displays.

## Relationships

### Conforms To

[`NSCoding`](/documentation/Foundation/NSCoding)

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

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

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

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

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

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

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

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

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

### Inherits From

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

---

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)