Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- HIG
- 클린 코드
- rxswift
- Human interface guide
- tableView
- Clean Code
- combine
- clean architecture
- uitableview
- 스위프트
- 애니메이션
- map
- Protocol
- 리펙터링
- swift documentation
- ribs
- collectionview
- SWIFT
- Refactoring
- UICollectionView
- MVVM
- 리팩토링
- RxCocoa
- ios
- Xcode
- 리펙토링
- swiftUI
- uiscrollview
- Observable
- UITextView
Archives
- Today
- Total
목록2024/01/22 (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift] 단순 열거 switch 리펙토링 (dictionary 활용하기)
단순 열거 switch 형태 단순히 자연수를 입력하면 한글로 변환시키는 목적이 있을때 아래처럼 사용이 가능 extension Int { var asHangul: String? { switch self { case 1: return "하나" case 2: return "둘" case 3: return "셋" case 4: return "넷" case 5: return "다섯" default: return nil } } } print(1.asHangul) // "하나" 이렇게 사용하게되면 switch, case, return문이 여러개 들어가게 되면서 길어질 수 있기 때문에, dictinoary를 활용하면 조금 더 단순하게 표현이 가능 extension Int { var asHangulV2: String? ..
Refactoring (리펙토링)
2024. 1. 22. 01:28