---
title: "pop(to:animated:)"
framework: carplay
role: symbol
role_heading: Instance Method
path: "carplay/cpinterfacecontroller/pop(to:animated:)"
---

# pop(to:animated:)

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

## Declaration

```swift
func pop(to targetTemplate: CPTemplate, animated: Bool)
```

## Parameters

- `targetTemplate`: The template that you want at the top of the stack. The template must be on the navigation stack before you call this method.
- `animated`: A Boolean value that indicates whether the system animates the display of transitioning templates. Set to doc://com.apple.documentation/documentation/Swift/true to animate the transition.

## See Also

### Deprecated Methods

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