-Swift Switch
1. 没有 break
2. 不仅仅局限在 int,可以对任何类型的数据进行 switch
3. 每一个 case 都必须至少有一条语句,如果实在没有,可以用 break
4. 如果要 switch 多值,使用 , 分隔
5. case 要涵盖所有的可能,如果不能列举,需要使用 default
穿透
func demo() {
let x = "9"
switch x {
case "10", "9": print("优")
case "8": print("良")
default: print("一般")
}
}