Enumerating enum cases in Swift

New in Swift 4.2 is the ability to specify that the compiler should generate a collection of an enum’s cases. In this post, Ole Begemann first shows us how we can use the new CaseIterable protocol with enums, before looking at how we can make other types CaseIterable.