Iterable Swift Enumeration

July 10, 2020 in Basics, Swift

Enumerations are powerful language features that provide static typing for small set of frequently used values. They are used to make code more readable and less error-prone.

CaseIterable is a feature as when used on an enumeration, the compiler automatically generate a static collection of all the cases defined Continue reading »

Defining a function argument with @autoclosure

July 9, 2020 in Basics, Swift

Swift’s @autoclosure is a syntax sugar attribute applied to a function argument to implicitly create a closure out of a passed in argument. @autoclosure can be useful in situations where you have a sequence of conditions and you want to keep the execution of these expressions in order, Continue reading »