Contents

callAsFunction(donate:)

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

Declaration

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() method, and returns the resulting value.

See Also

Donating the intent to the system