Class

CPListTemplate

A template that displays a hierarchical list of items.

Declaration

@interface CPListTemplate : CPTemplate

Overview

When creating a list template, populate the list with an array of CPListSection objects. Each section contains an array of CPListItem objects. Each list item contains a title, and may also include a subtitle, image, and disclosure indicator to show the presence of a sublist.

To display the list on the CarPlay screen, call the interface controller’s pushTemplate:animated: method, passing in the list template. When the user selects an item from the list, the system calls listTemplate:didSelectListItem:completionHandler:, which your delegate object implements.

Topics

Creating a List Template

- initWithTitle:sections:

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

CPListSection

A section of list items that appear in a list template.

Handling List Template Events

delegate

The object serving as the delegate to the list template.

CPListTemplateDelegate

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

Managing List Sections

sections

The sections displayed in the list.

- updateSections:

Updates the list with the provided sections.

Getting the Title

title

The title displayed in the navigation bar while the list template is visible.

Relationships

Inherits From

See Also

User Interface Basics

CPInterfaceController

A controller that manages the templates that provide the user interface for your app on the CarPlay screen.

CPMapTemplate

A template that provides a navigation bar and map buttons allowing users to interact with your app.

CPGridTemplate

A template that displays a grid of items.

CPTemplate

An abstract base class for interface templates.

CPImageSet

Light and dark representations of an image.