CaseIterable Swift

enum Color: CaseIterable {
    case red, green, blue
}
// example:
for color in Color.allCases {
    print("My favorite color is \(color).")
}
Quaint Quail