---
title: "init(visualCodeType:)"
framework: intents
role: symbol
role_heading: Initializer
path: "intents/ingetvisualcodeintent/init(visualcodetype:)"
---

# init(visualCodeType:)

Initializes the intent object with information about the requested type of code.

## Declaration

```swift
init(visualCodeType: INVisualCodeType)
```

## Parameters

- `visualCodeType`: The type of visual code that the user requested. For a list of possible values, see doc://com.apple.sirikit/documentation/Intents/INVisualCodeType.

## Return Value

Return Value An initialized intent object or nil if the object could not be created.

## Discussion

Discussion Normally, you don’t create instances of this class yourself. Instead, SiriKit creates instances when the user asks for a visual code from your app. However, you can use this method during testing to create intent objects in order to validate your intent handling code paths.
