Proof of Concept: Enum with associated function

In Swift, functions are first class citizens The above does not come as a surprise. We’re using closures as callback handlers, and store them – frequently as optionals – save them, pass them around. I’ve used them as a variable in an enum: depending on the value of the enum, I return a different closure. […]