CPListItem
A selectable row in a list template.
Declaration
@MainActor class CPListItemOverview
A list item manages the content of a single row in a list template. CarPlay manages the layout of a list item and may adjust its layout to allow for the display of auxiliary content, such as an accessory or a Now Playing indicator. A list item can display primary and secondary text and an image. It can also show an accessory or custom accessory image, and one of several indicators that the system provides.
You assign a handler to a list item that CarPlay executes when the user selects the item. The handler receives the item and a closure that you must call after you finish processing the selection.
CarPlay doesn’t support custom list item types. Instead, use the userInfo property to attach a value to the list item that provides additional context, such as specifying a model object that corresponds to the item.
Topics
Creating a List Item
init(text:detailText:)init(text:detailText:image:)init(text:detailText:image:accessoryImage:accessoryType:)
Managing Configuration
Managing Accessories
Managing Content
Managing Playback Information
isExplicitContentisPlayingplayingIndicatorLocationCPListItemPlayingIndicatorLocationplaybackProgress