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

# CPVoiceControlState

A voice control state containing title variants and images for use by a voice control template.

```
class CPVoiceControlState
```

## Topics

### Creating a Voice Control State

[`init(identifier: String, titleVariants: [String]?, image: UIImage?, repeats: Bool)`](/documentation/CarPlay/CPVoiceControlState/init(identifier:titleVariants:image:repeats:))

Creates a voice control state.

### Getting State Information

[`var identifier: String`](/documentation/CarPlay/CPVoiceControlState/identifier)

The string that your app uses to identify the voice control state.

[`var titleVariants: [String]?`](/documentation/CarPlay/CPVoiceControlState/titleVariants)

The array of title variants for the voice control state.

[`var image: UIImage?`](/documentation/CarPlay/CPVoiceControlState/image)

The image displayed while the voice control template is in this state.

[`var repeats: Bool`](/documentation/CarPlay/CPVoiceControlState/repeats)

A Boolean value that indicates whether the display of an animated image repeats the animation sequence indefinitely.

### Initializers

[`init?(coder: NSCoder)`](/documentation/CarPlay/CPVoiceControlState/init(coder:))

[`init(identifier: String, titleVariants: [String]?, image: UIImage?, backgroundImage: UIImage?, repeats: Bool)`](/documentation/CarPlay/CPVoiceControlState/init(identifier:titleVariants:image:backgroundImage:repeats:))

Initialize a voice control state with a title and image.

### Instance Properties

[`var actionButtons: [CPButton]`](/documentation/CarPlay/CPVoiceControlState/actionButtons)

An array of action buttons displayed in the template.

[`var backgroundImage: UIImage?`](/documentation/CarPlay/CPVoiceControlState/backgroundImage)

A custom background image to be displayed behind the voice control template content.

### Type Properties

[`class var maximumActionButtonCount: Int`](/documentation/CarPlay/CPVoiceControlState/maximumActionButtonCount)

The maximum number of action buttons that can be displayed in the CPVoiceControlTemplate.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)