티스토리 뷰

매우 오래전부터 궁금했던 질문...

 

 

 

이런식으로 여러개중에 하나만 해당될 때, 코드를 예쁘게 짜고싶다면?????/

 

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를 이용한게 그나마 나은것같다 !.!

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함