Dynamic Member Lookup in Swift

Use this with strings and keypaths

Artturi Jalli

--

Drawing of code on device
Photo by the author.

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.

--

--

Artturi Jalli

Youtube: @jalliartturi to take your blog to the next level