Swift 6 · Basics and optionals
Loops and switch
switch must be exhaustive and supports patterns and ranges.
for number in 1...3 { print(number) }
switch score {
case 0..<50: print("low")
case 50...: print("high")
default: break
}
Official Swift 6 documentation