Reflection

Quick Introduction Reflection in Swift

Published on

If you have been programming for a few years, you have undoubtedly come across the term Reflection. This feature allows us to inspect and work with the members of a type.

if this doesn’t make sense, suppose you wanted to check what members a type has. How would you do this? Ideally you’d like to iterate over its members and print them. This is a very basic application of Reflection, but it should let think of other potential uses for it.