Contents

Parameter resolution

Define the required parameters for your app intents and specify how to resolve those parameters at runtime.

Overview

Parameters represent input arguments to your app intents and offer additional metadata to the system. When you define an app intent, add the @Parameter property wrapper to any properties you use as input. For example, an app intent that sends a message might include a parameter for the recipient and message string. The system collects and resolves the relevant parameter information before it performs your app intent.

The following partial example shows how to declare parameters for a custom app intent that enables someone to order soup from your app. Configure the parameter property wrapper with any additional details that help the system infer extra information about your parameter.

struct OrderSoupIntent: AppIntent {
    @Parameter(title: "Soup")
    var soup: Soup
    
    @Parameter(title: "Quantity", inclusiveRange: (1, 10))
    var quantity: Int

    // Other properties
}

Topics

Intent parameters

Parameter choices

Shortcuts support

See Also

Parameters and data types