Exploring Different Behaviours in Swift Enums
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?
Published 27 July 2019