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 |
Tags
- SWIFT
- 리펙터링
- Refactoring
- Clean Code
- UICollectionView
- Observable
- 애니메이션
- RxCocoa
- Xcode
- HIG
- Protocol
- ios
- clean architecture
- MVVM
- swift documentation
- uitableview
- 리펙토링
- uiscrollview
- ribs
- 클린 코드
- tableView
- collectionview
- UITextView
- map
- swiftUI
- 리팩토링
- combine
- 스위프트
- rxswift
- Human interface guide
Archives
- Today
- Total
목록2022/09/06 (1)
김종권의 iOS 앱 개발 알아가기
[iOS - Swift] map, flatMap 이해하기, 직접 구현 방법 (+ json to model, json to dictionary)
Swift에서의 map의 역할 map, flatMap 둘 다 클로저가 Optional일 때와 non-Optional일때의 기능이 다르므로 주의 Optional일때의 기능 - 형변환 (flatMap은 형변환을 완료하고 unwrapping까지 수행) non-Optional일때의 기능 - 원소들에 하나하나씩 접근하여 변형을 주는 것 non-Optional일때의 map 예시) let someString = "123456" let newString = someString .map { String($0) + "a" } print(newString) // ["1a", "2a", "3a", "4a", "5a", "6a"] non-Optional일때의 flatMap 예시) flatMap의 역할 - Sequence의 배열..
iOS 응용 (swift)
2022. 9. 6. 22:37