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


@interface CPInterfaceController : NSObject


An interface controller manages one or more templates in the navigation hierarchy. You don’t create the interface controller. Instead, the system creates it for you, and passes the controller to your app by way of the CPApplicationDelegate method application:didConnectCarInterfaceController:toWindow:. For more information, see Adding CarPlay Support to Your Navigation App.

After receiving the controller, store a reference to it in your app. Then set the root template by calling the setRootTemplate:animated: method. To display another template in the navigation hierarchy, call pushTemplate:animated:, and use popTemplateAnimated: to remove the top-most template.

You also use the interface controller to display a single template modally. Call presentTemplate:animated: to display the modal template, and call dismissTemplateAnimated: to dismiss it.


Configuring the Interface Controller

- setRootTemplate:animated:

Sets the root template, starting a new stack for the template navigation hierarchy.


An object serving as the delegate to the interface controller.


The interface that an object implements to serve as a delegate to an interface controller.

Accessing Templates on the Navigation Stack


The current root template in the template navigation hierarchy.


The top-most template in the navigation hierarchy stack.


The current stack of templates in the navigation hierarchy.

Pushing and Popping Templates

- pushTemplate:animated:

Pushes a template onto the navigation stack and updates the CarPlay display.

- popTemplateAnimated:

Pops the top template from the navigation stack and updates the CarPlay display.

- popToRootTemplateAnimated:

Pops all templates on the stack—except the root template—and updates the CarPlay display.

- popToTemplate:animated:

Pops templates until the specified template is at the top of the navigation stack.

Displaying Templates Modally

- presentTemplate:animated:

Presents a template modally.

- dismissTemplateAnimated:

Dismisses the template that the interface controller is displaying modally.


The current modal template displayed by the interface controller.


Inherits From

See Also

User Interface Basics


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


A template that displays a hierarchical list of items.


A template that displays a grid of items.


An abstract base class for interface templates.


Light and dark representations of an image.