Dynamic Member Lookup in Swift
Use this with strings and keypaths
2 min readMay 6, 2021
Dynamic member lookup improves interoperability with dynamic languages such as Python, Javascript, Ruby, etc.
It allows you to look at values from a dictionary with a syntax similar to when accessing a regular property of a type. For example, you can replace dog.props["color"]
with just dog.color
.