<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/onAppIntentExecution(_:perform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewP012_AppIntents_aB0E02onD15IntentExecution_7performQrqd__m_yqd__ScMYcct0dE0022TargetContentProvidingG0Rd__lF"
  },
  "title" : "onAppIntentExecution(_:perform:)"
}
-->

# onAppIntentExecution(_:perform:)

Registers a handler to run when the app receives an app intent that targets the associated scene.

```
nonisolated func onAppIntentExecution<I>(_ intent: I.Type = I.self, perform action: @escaping @MainActor (I) -> Void) -> some View where I : TargetContentProvidingIntent
```

## Parameters

`intent`

The type of app intent that the `action` closure handles.

`action`

A closure for SwiftUI to call when it receives the specified type of app intent. The closure takes
the received app intent instance as an input parameter.

## Return Value

A view that handles the specified app intent.

## Discussion

Add this modifier to a view and use it to receive app intents intended for one of your scenes. In your handler, use the
contents of the app intent to configure the views of your scene. For example, retrieve the item from an `OpenIntent`
type and display it in your views. Your closure runs before the app comes to the foreground and before the system calls the
app intent’s `AppIntent/perform()` method, so you can use the closure to configure your interface in advance.

> Note: In your closure, you can inspect the parameter values of the app intent, but cannot perform interactive requests with it.
> For example, you can’t call the <doc://com.apple.documentation/documentation/AppIntents/IntentParameter/requestValue(_:)-592nd>
> or <doc://com.apple.documentation/documentation/AppIntents/IntentParameter/needsValueError(_:)> methods.

To route app intents to a particular scene, add the
<doc://com.apple.documentation/documentation/SwiftUI/View/handlesExternalEvents(preferring:allowing:)> modifier
to your view or the <doc://com.apple.documentation/documentation/SwiftUI/Scene/handlesExternalEvents(matching:)>
modifier to your <doc://com.apple.documentation/documentation/SwiftUI/Scene> type. For each modifier, you supply one or
more strings to match against the target content modifier of an incoming app intent. SwiftUI delivers only matching app intents to this modifier.

---

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)