Question : caseiterable swift
Answered by : quaint-quail-rblyi6q3wthz
enum Color: CaseIterable { case red, green, blue
}
// example:
for color in Color.allCases { print("My favorite color is \(color).")
}
Source : https://www.hackingwithswift.com/example-code/language/how-to-list-all-cases-in-an-enum-using-caseiterable | Last Update : Thu, 27 May 21