Dynamism

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.


Understanding @dynamicMemberLookup and @dynamicCallable in Swift

Published on

If you have written code in a programming language such as Python or PHP, you can find many direct comparisons to Swift. For one, Swift is statically typed, whereas PHP and Python are not - Swift is considered a safe language as it has a bunch of features to protect you against mistakes - static typing, error throwing, optionality for dealing with nulls, to name a few -, whereas PHP and Python do not.