📜  caseiterable swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.844000             🧑  作者: Mango

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