Say we have an enum:
enum MyEnum {
case foo(Int)
case bar
}
and we can do something like this:
func myFunc(_ foo: MyEnum, _ bar: MyEnum) {
if case .foo(_) = foo, case .bar = bar {...}
}
but what if I need some like this
if case .foo(_) = foo, case .bar = bar OR someVar == true {...}
where I want either case .foo(_) = foo, case .bar = bar
to be true, or someVar
to be true.
Apparently I can't put ||
there, and I couldn't figure out an alternative. Am I missing something simple?