where : 用于條件判斷
let point = (1, -1)
switch point {
case let (x, y) where x == y:
print("x == y")
case let (x, y) where x > y:
print("x > y")
case let (x, y) where x < y:
print("x < y")
where : 用于條件判斷
let point = (1, -1)
switch point {
case let (x, y) where x == y:
print("x == y")
case let (x, y) where x > y:
print("x > y")
case let (x, y) where x < y:
print("x < y")