These labels allow you to group items in an enum:
enum X {
L1:
case A, B
case C
L2:
case D, E, F
}
switch x {
case L1: handleL1(x)
case L2: handleL2(x)
}
func handleL1(x:X) {
switch x L1 {
case .A: ...
case .B: ...
case .D: ...
}
}
func handleL2(x:X) {
switch x L2 {
case .D: ...
case .E: ...
case .F: ...
}
}