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

# presentTemplate(_:animated:)

Presents a template modally.

## Declaration

```swift
func presentTemplate(_ templateToPresent: CPTemplate, animated: Bool)
```

## Parameters

- `templateToPresent`: A template to display over currently displayed content on the CarPlay screen. The template must be one of the following types: doc://com.apple.carplay/documentation/CarPlay/CPActionSheetTemplate doc://com.apple.carplay/documentation/CarPlay/CPAlertTemplate doc://com.apple.carplay/documentation/CarPlay/CPVoiceControlTemplate
- `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.

## Discussion

Discussion You can present only one template at a time.

## 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)
- [pop(to:animated:)](carplay/cpinterfacecontroller/pop(to:animated:).md)
- [dismissTemplate(animated:)](carplay/cpinterfacecontroller/dismisstemplate(animated:).md)
