---
title: "setIntent(intent:)"
framework: appintents
role: symbol
role_heading: Instance Method
path: "appintents/siritipuiview/setintent(intent:)"
---

# setIntent(intent:)

Sets an AppIntent for this view. This must be called before presenting the view.

## Declaration

```swift
@MainActor @preconcurrency final func setIntent<Intent>(intent: Intent) where Intent : AppIntent
```

## Discussion

Discussion The provided AppIntent must be a valid App Shortcut for this view to work correctly.
