macOS, iOS
[iOS] if (a==b|| a==c || a==d)를 줄일수는 없을까?
SweetDev
2020. 7. 13. 18:12
매우 오래전부터 궁금했던 질문...

이런식으로 여러개중에 하나만 해당될 때, 코드를 예쁘게 짜고싶다면?????/
stackoverflow.com/questions/51673321/swift-if-statement-with-a-equals-to-b-or-c
Swift: 'if' statement with a equals to b or c
If I want to make sure that variable A is equal to B or C in Swift, I would normally write something like: if a == b || a == c { //Do Something } However, I wonder if there is a shorthand vers...
stackoverflow.com
switch를 이용한게 그나마 나은것같다 !.!
