Contents

subscript(dynamicMember:)

Accesses a nested entity property by name.

Declaration

subscript(dynamicMember identifier: String) -> DynamicPropertyPath { get }

Overview

The code below shows the syntactic sugar and the equivalent, desugared, subscript syntax.

try entity.customer.name == "My Name"
try entity[dynamicMember: "customer"][dynamicMember: "name"] == "My Name"

For more information about dynamic-member syntax, see dynamicMemberLookup in The Swift Programming Language.