Enum iterations in Swift 4.2 — Swift by Sundell


With each new release, Swift keeps getting better and better at creating compiler-generated implementations of common boilerplate. One such new feature in Swift 4.2 is the new CaseIterable protocol - that enables us to tell the compiler to automatically synthesize an allCases collection for any RawRepresentable enum. John Sundell takes a look at some examples of scenarios in which this new feature can come very much in handy.


Want to receive more content like this in your inbox?