subscript(_:)
Accesses a collection element by index, without casting.
Declaration
subscript(index: Int) -> (any IntentValueExpressing)? { get throws }Overview
The code below shows the syntactic sugar and the equivalent, desugared, subscript syntax.
let result = try await intent.run() // Expected an array as result value
result.value[0] == nil
CreateCoffeeIntent.makeIntent(customerName: result.value[0])For more information about dynamic-member syntax, see dynamicMemberLookup in The Swift Programming Language.