Use key-path expressions to access properties dynamically.
Key-Path Expressions
Topics
Key Paths
class KeyPath
A key path from a specific root type to a specific resulting value type.
class PartialKeyPath
A partially type-erased key path, from a concrete root type to any resulting value type.
class AnyKeyPath
A type-erased key path, from any root type to any resulting value type. NOTE: older runtimes had Swift.AnyKeyPath as the ObjC name. The two must coexist, so it was renamed. The old name must not be used in the new runtime. _TtCs11_AnyKeyPath is the mangled name for Swift._AnyKeyPath.
protocol _AppendKeyPath
An implementation detail of key path expressions; do not use this protocol directly.
Writable Key Paths
class WritableKeyPath
A key path that supports reading from and writing to the resulting value.
class ReferenceWritableKeyPath
A key path that supports reading from and writing to the resulting value with reference semantics.
See Also
Programming Tasks
Print values to the console, read from and write to text streams, and use command line arguments.
Fortify your code with runtime checks, and examine your values' runtime representation.
Allocate and manage memory manually.
Perform casts between types or represent values of any type.
Use imported C types or call C variadic functions.
Work with prefix, postfix, and infix operators.