---
title: "activateVoiceControlState(withIdentifier:)"
framework: carplay
role: symbol
role_heading: Instance Method
path: "carplay/cpvoicecontroltemplate/activatevoicecontrolstate(withidentifier:)"
---

# activateVoiceControlState(withIdentifier:)

Changes the template’s state to the one matching the specified identifier.

## Declaration

```swift
func activateVoiceControlState(withIdentifier identifier: String)
```

## Parameters

- `identifier`: An identifier corresponding to one of the doc://com.apple.carplay/documentation/CarPlay/CPVoiceControlTemplate/voiceControlStates associated with the template.

## Discussion

Discussion Your app must present the voice control template using its CPInterfaceController object before the app can activate a new state. Calling this method before presenting the template has no effect on the active state. note: The voice control template applies a rate limit for voice control states, ignoring state changes occurring too rapidly or frequently in a short period of time.

## See Also

### Activating a State

- [activeStateIdentifier](carplay/cpvoicecontroltemplate/activestateidentifier.md)
