<!--
{
  "availability" : [
    "iOS: 12.0.0 - 14.0.0",
    "iPadOS: 12.0.0 - 14.0.0",
    "macCatalyst: 13.1.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPInterfaceController/setRootTemplate(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPInterfaceController(im)setRootTemplate:animated:"
  },
  "title" : "setRootTemplate(_:animated:)"
}
-->

# setRootTemplate(_:animated:)

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

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

## Parameters

`rootTemplate`

The root template. Replaces the current [`rootTemplate`](/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 [`rootTemplate`](/documentation/CarPlay/CPInterfaceController/rootTemplate).

---

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)