I'm searching for the syntax to do pattern matching with multiple cases in an if case statement. The example would be this:
enum Gender {
case Male, Female, Transgender
}
let a = Gender.Male
Now I want to check, if a is .Male OR .Female. But I would like to avoid using switch for this. However the switch statement would be like this:
switch a {
case .Male, .Female:
// do something
}
Is it possible to write this with if case? I would expect this, but it didn't work :(
if case .Male, .Female = a {
}