I have a dilemma; the Swift
enum is a first-class type and, if we’re to obey the laws of encapsulation, an
enum type should own its functionality. But can we do this in a nice way, when its behaviour is different for each value in the enum?
In this post, we’ll explore the old Java type-safe enumeration pattern, revisit my old enums are meant for switching blogpost, and try to combine the lot.Read more