Tag: if case

如果情况的补充

你怎么写这个: if case .SomeEnum(3) = enumType where myInt == 3 { //I don't need this case } else { //This is the case I need } 我知道我可以使用guard : guard case .SomeEnum(3) = enumType where myInt == 3 else { //This is the case I need } 但我不认为它是干净的,因为它不是真正的function不能完成的情况。 另外, guard期望我从function中返回。 任何其他的select?