caseiterable swift

166

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

Comments

Submit
0 Comments