Here I have enum which I check in switch
enum Action { case Walk(meters : Int) case Run(meters : Int, speed : Int) case Stop case Turn(direction : Direction) enum Direction { case Left case Right } } func checkAction (action : Action) { switch action { case Action.Run(let meters, let a) where meters < 32: print("Run \(a)", terminator : "") default: break } } This is how it works, but if I ask two conditions, it does not work
case Action.Run(let meters, let a) where meters < 32, a < 22: print("Run \(a)", terminator : "") What am I doing wrong?
enumand there is a function that accepts it. In theswitchfunction which, depending on the value, performs the actions. So my question is how to set two conditions in aswitch casewheresimilar to that described in the question. Read carefully the question if you wanted to be useful. Did not want to offend, if that) - Aleksey Timoshchenko