---
title: "init(voiceControlStates:)"
framework: carplay
role: symbol
role_heading: Initializer
path: "carplay/cpvoicecontroltemplate/init(voicecontrolstates:)"
---

# init(voiceControlStates:)

Creates a voice control template with a list of voice control states.

## Declaration

```swift
init(voiceControlStates: [CPVoiceControlState])
```

## Parameters

- `voiceControlStates`: An array of voice control states associated with the template. You can provide up to five states. If you provide more, the template ignores any states after the first five in the array.

## Return Value

Return Value A newly initialized voice control template.

## Discussion

Discussion When presenting the voice control template for the first time, the template defaults to the first state in the voiceControlStates array. You can change the state after presenting the template by calling the activateVoiceControlState(withIdentifier:) method.

## See Also

### Creating a Voice Control Template

- [CPVoiceControlState](carplay/cpvoicecontrolstate.md)
