Contents

CPNowPlayingImageButton

A button that displays an image.

Declaration

@MainActor class CPNowPlayingImageButton

Overview

CPNowPlayingImageButton is a concrete subclass of 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 property—and make sure it is no larger than CPNowPlayingButtonMaximumImageSize.

Topics

Creating a Button

Getting the Button’s Image

See Also

Managing the Template’s Buttons