caseiterable swift

170

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

Comments

Submit
0 Comments