subscript(dynamicMember:)
Accesses an entity property by name, without casting.
Declaration
subscript(dynamicMember identifier: String) -> (any IntentValueExpressing)? { get set }Overview
The code below shows the syntactic sugar and the equivalent, desugared, subscript syntax.
entity.someName == nil
entity[dynamicMember: "someName"] == nil
CreateCoffeeIntent.makeIntent(customerName: entity.someName)
CreateCoffeeIntent.makeIntent(customerName: entity[dynamicMember: "someName"])For more information about dynamic-member syntax, see dynamicMemberLookup in The Swift Programming Language.