티스토리 뷰
매우 오래전부터 궁금했던 질문...
이런식으로 여러개중에 하나만 해당될 때, 코드를 예쁘게 짜고싶다면?????/
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를 이용한게 그나마 나은것같다 !.!
'macOS, iOS' 카테고리의 다른 글
[iOS] stackview 중간에 넣기, stackview에서 빼기 (0) | 2020.07.14 |
---|---|
[iOS] SFSymbol image를 코드로 넣는 법 (0) | 2020.07.14 |
[iOS] 비밀번호 sha-512, base64 encoding하기 (0) | 2020.07.13 |
[iOS] textview에 placeholder 추가하기 (0) | 2020.07.03 |
[Swift] 범위 나타내기 (0) | 2020.07.03 |