IntentParameterDependency
A property wrapper that represents an app intent dependency you use to provide dynamic options.
Declaration
@propertyWrapper final class IntentParameterDependency<Intent> where Intent : AppIntentOverview
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
init(_:)init(_:_:)init(_:_:_:)init(_:_:_:_:)init(_:_:_:_:_:)init(_:_:_:_:_:_:)init(_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:_:_:_:_:_:_:)init(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)