---
title: CPInterfaceController
framework: carplay
role: symbol
role_heading: Class
path: carplay/cpinterfacecontroller
---

# CPInterfaceController

A controller that manages the templates for constructing a scene’s user interface.

## Declaration

```swift
@MainActor class CPInterfaceController
```

## Overview

Overview An interface controller manages one or more templates in the navigation hierarchy. You don’t create the interface controller. Instead, CarPlay creates one for you and passes it to the delegate of CPTemplateApplicationScene when the scene connects. After receiving the controller, store a reference to it in your app. Then set the root template by calling the setRootTemplate(_:animated:completion:) method. To display another template in the navigation hierarchy, call pushTemplate(_:animated:completion:), and use popTemplate(animated:completion:) to remove the top-most template. You also use the interface controller to display a single template modally. Call presentTemplate(_:animated:completion:) to display the modal template, and call dismissTemplate(animated:completion:) to dismiss it.

## Topics

### Configuring the Interface Controller

- [delegate](carplay/cpinterfacecontroller/delegate.md)
- [CPInterfaceControllerDelegate](carplay/cpinterfacecontrollerdelegate.md)
- [prefersDarkUserInterfaceStyle](carplay/cpinterfacecontroller/prefersdarkuserinterfacestyle.md)
- [setRootTemplate(_:animated:completion:)](carplay/cpinterfacecontroller/setroottemplate(_:animated:completion:).md)

### Accessing the Trait Collection

- [carTraitCollection](carplay/cpinterfacecontroller/cartraitcollection.md)

### Accessing Templates

- [rootTemplate](carplay/cpinterfacecontroller/roottemplate.md)
- [topTemplate](carplay/cpinterfacecontroller/toptemplate.md)
- [templates](carplay/cpinterfacecontroller/templates.md)

### Adding and Removing Templates

- [pushTemplate(_:animated:completion:)](carplay/cpinterfacecontroller/pushtemplate(_:animated:completion:).md)
- [popTemplate(animated:completion:)](carplay/cpinterfacecontroller/poptemplate(animated:completion:).md)
- [popToRootTemplate(animated:completion:)](carplay/cpinterfacecontroller/poptoroottemplate(animated:completion:).md)
- [pop(to:animated:completion:)](carplay/cpinterfacecontroller/pop(to:animated:completion:).md)

### Displaying Templates Modally

- [presentTemplate(_:animated:completion:)](carplay/cpinterfacecontroller/presenttemplate(_:animated:completion:).md)
- [dismissTemplate(animated:completion:)](carplay/cpinterfacecontroller/dismisstemplate(animated:completion:).md)
- [presentedTemplate](carplay/cpinterfacecontroller/presentedtemplate.md)

### Deprecated

- [Deprecated Symbols](carplay/cpinterfacecontroller-deprecated-symbols.md)

### Instance Methods

- [hideOverlayTemplate(animated:completion:)](carplay/cpinterfacecontroller/hideoverlaytemplate(animated:completion:).md)
- [showOverlayTemplate(_:animated:completion:)](carplay/cpinterfacecontroller/showoverlaytemplate(_:animated:completion:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### Accessing the Interface Controller

- [interfaceController](carplay/cptemplateapplicationscene/interfacecontroller.md)
