Contents

IntentParameterDependency

A property wrapper that represents an app intent dependency you use to provide dynamic options.

Declaration

@propertyWrapper final class IntentParameterDependency<Intent> where Intent : AppIntent

Overview

Use the IntentParameterDependency property wrapper for properties that represent dynamic options in your DynamicOptionsProvider implementations as shown in the following example:

struct SoupQuery: EntityStringQuery {
    @IntentParameterDependency<OrderSoup>(
        \.$quantity
    )
    var orderSoup

    func entities(matching string: String) async throws -> [Soup] {
        guard let orderSoup else {
            return []
        }
        return Soup.allSoups.filter {
            $0.name.contains(string) &&
            $0.availableQuantity >= orderSoup.quantity
        }
    }
}

Topics

Initializers

Instance Properties

See Also

Intent parameters