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

# CPListTemplate

A template that displays and manages a list of items.

```
@MainActor class CPListTemplate
```

## Overview

Use the list template to display a list of items, grouped into one or more sections. When the user selects an item, CarPlay invokes Siri or a custom handler that you provide, depending on the type of list item. If your list displays hierarchical data, use the handler to add templates to the navigation hierarchy.

To create a list template, call the [`init(title:sections:)`](/documentation/CarPlay/CPListTemplate/init(title:sections:)) method and provide an array of [`CPListSection`](/documentation/CarPlay/CPListSection) objects. At runtime, use [`maximumSectionCount`](/documentation/CarPlay/CPListTemplate/maximumSectionCount) to determine the maximum number of sections your list can display. Use [`maximumItemCount`](/documentation/CarPlay/CPListTemplate/maximumItemCount) to determine the maximum number of items across all sections that your list can display.

Each section contains an array of list items — objects that conform to either the [`CPListTemplateItem`](/documentation/CarPlay/CPListTemplateItem) or the [`CPSelectableListItem`](/documentation/CarPlay/CPSelectableListItem) protocol. CarPlay provides three concrete implementations of these protocols:

- [`CPListItem`](/documentation/CarPlay/CPListItem): A generic, selectable list item.
- [`CPListImageRowItem`](/documentation/CarPlay/CPListImageRowItem): A list item that displays a series of images.
- [`CPMessageListItem`](/documentation/CarPlay/CPMessageListItem): A list item that represents a conversation or contact.

> Note:
> The depth of a hierarchical list in CarPlay depends on your app’s entitlements. Food-ordering apps must not exceed two levels. The framework restricts all other categories of apps to five levels. Also, some vehicles limit the number of items that the list displays. See ``doc://com.apple.carplay/documentation/CarPlay/CPSessionConfiguration`` for more information.

To display the list, call your interface controller’s [`pushTemplate(_:animated:completion:)`](/documentation/CarPlay/CPInterfaceController/pushTemplate(_:animated:completion:)) method, passing in the list template to add it to your navigation hierarchy. Alternatively, add the template as a tab in your [`CPTabBarTemplate`](/documentation/CarPlay/CPTabBarTemplate).

### Integrating Siri Into Your Template App

For audio and communication apps, CarPlay provides an *assistant cell* to let users interact with your app using Siri_._

![Screenshot that shows the assistant cell at the top of a list template.](images/com.apple.carplay/media-3786976@2x.png)

To enable the assistant cell, your app must support specific Siri intents:

- To play audio, audio apps must support <doc://com.apple.documentation/documentation/Intents/INPlayMediaIntent>.
- To make phone calls, communication apps must support <doc://com.apple.documentation/documentation/Intents/INStartCallIntent>.

To enable the assistant cell in your list template, use [`init(title:sections:assistantCellConfiguration:)`](/documentation/CarPlay/CPListTemplate/init(title:sections:assistantCellConfiguration:)) and provide the required configuration. For more information, see [`CPAssistantCellConfiguration`](/documentation/CarPlay/CPAssistantCellConfiguration). CarPlay automatically updates your app’s interface if you change the template’s [`assistantCellConfiguration`](/documentation/CarPlay/CPListTemplate/assistantCellConfiguration) property.

## Topics

### Creating a List Template

[`-  initWithTitle:sections:`](/documentation/CarPlay/CPListTemplate/init(title:sections:))

Creates a list template with an array of list sections and optional title.

[`-  initWithTitle:sections:assistantCellConfiguration:`](/documentation/CarPlay/CPListTemplate/init(title:sections:assistantCellConfiguration:))

Creates a sectioned list template that optionally displays the assistant cell.

### Managing Sections

[`maximumSectionCount`](/documentation/CarPlay/CPListTemplate/maximumSectionCount)

The maximum number of sections that the template can display.

[`sectionCount`](/documentation/CarPlay/CPListTemplate/sectionCount)

The number of sections in the list.

[`sections`](/documentation/CarPlay/CPListTemplate/sections)

The sections that the list displays.

[`-  updateSections:`](/documentation/CarPlay/CPListTemplate/updateSections(_:))

Adds, removes, reorders, or updates the list’s sections.

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

A container that groups your list items into sections.

### Managing the Assistant Cell

[`assistantCellConfiguration`](/documentation/CarPlay/CPListTemplate/assistantCellConfiguration)

The object that provides the configuration attributes for the assistant cell.

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

An object that provides the configuration attributes for the assistant cell.

### Managing an Empty List

[`emptyViewTitleVariants`](/documentation/CarPlay/CPListTemplate/emptyViewTitleVariants)

An array of title variants for the template’s empty view.

[`emptyViewSubtitleVariants`](/documentation/CarPlay/CPListTemplate/emptyViewSubtitleVariants)

An array of subtitle variants for the template’s empty view.

### Getting Supplementary Information

[`maximumItemCount`](/documentation/CarPlay/CPListTemplate/maximumItemCount)

The maximum number of items, across all sections, that the template can display.

[`itemCount`](/documentation/CarPlay/CPListTemplate/itemCount)

The total number of items, across all sections, in the list.

[`-  indexPathForItem:`](/documentation/CarPlay/CPListTemplate/indexPath(for:))

Returns the index path for the specified item.

[`title`](/documentation/CarPlay/CPListTemplate/title)

The title that the navigation bar displays when the template is visible.

### Responding to List Events

[`delegate`](/documentation/CarPlay/CPListTemplate/delegate)

The object that serves as the delegate to the list template.

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

The interface an object implements to serve as the delegate for a list template.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)