let num = 10
switch num{
case 0...20
println("Go On")
fallthough
default
println("the end")
}
打印结果
Go On
the end
即在特殊情况下需要继续执行case后面的语句时,写fallthough。
let num = 10
switch num{
case 0...20
println("Go On")
fallthough
default
println("the end")
}
打印结果
Go On
the end
即在特殊情况下需要继续执行case后面的语句时,写fallthough。