---
title: "setRootTemplate(_:animated:)"
framework: carplay
role: symbol
role_heading: Instance Method
path: "carplay/cpinterfacecontroller/setroottemplate(_:animated:)"
---

# setRootTemplate(_:animated:)

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

## Declaration

```swift
func setRootTemplate(_ rootTemplate: CPTemplate, animated: Bool)
```

## Parameters

- `rootTemplate`: The root template. Replaces the current doc://com.apple.carplay/documentation/CarPlay/CPInterfaceController/rootTemplate, if one exists.
- `animated`: Set to doc://com.apple.documentation/documentation/Swift/true to animate the presentation of the root template; ignored if there isn’t a current doc://com.apple.carplay/documentation/CarPlay/CPInterfaceController/rootTemplate.

## See Also

### Deprecated Methods

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