<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/AppIntent/callAsFunction(donate:)-3qvbt",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents0A6IntentPAAE14callAsFunction6donate13PerformResult_5ValueQZSb_tYaKAA07ReturnsJ0AFRpzrlF"
  },
  "title" : "callAsFunction(donate:)"
}
-->

# callAsFunction(donate:)

Runs the intent’s action after resolving any parameters, returns the resulting value,
and optionally donates the intent to the system.

```
func callAsFunction(donate donateOnCompletion: Bool = true) async throws -> Self.PerformResult.Value where Self.PerformResult : ReturnsValue
```

## Parameters

`donateOnCompletion`

`true` if you want to donate the intent to the system after performing the action.

## Return Value

The value the action returns, if any.

## Discussion

Call this method when you want to perform the current app intent’s action. For example,
you might call this method if you use your app intent types to implement your app’s underlying
features. This method resolves the parameters of the intent, calls its [`perform()`](/documentation/AppIntents/AppIntent/perform())
method, and returns the resulting value.

---

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)