<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPVoiceControlTemplate/init(voiceControlStates:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPVoiceControlTemplate(im)initWithVoiceControlStates:"
  },
  "title" : "init(voiceControlStates:)"
}
-->

# init(voiceControlStates:)

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

```
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

A newly initialized voice control template.

## 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:)`](/documentation/CarPlay/CPVoiceControlTemplate/activateVoiceControlState(withIdentifier:)) method.

---

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)