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
- Protocol
- collectionview
- 리펙터링
- UITextView
- 스위프트
- ribs
- SWIFT
- Observable
- HIG
- uitableview
- 리팩토링
- tableView
- 애니메이션
- 클린 코드
- MVVM
- Clean Code
- Xcode
- Human interface guide
- map
- swift documentation
- Refactoring
- combine
- 리펙토링
- clean architecture
- RxCocoa
- UICollectionView
- rxswift
- ios
- swiftUI
- uiscrollview
Archives
- Today
- Total
목록2022/11/08 (1)
김종권의 iOS 앱 개발 알아가기
[iOS - SwiftUI] Combine filtering 연산자 (filter, tryFilter, compactMap, tryCompactMap, removeDuplicates, tryRemoveDuplicates, replaceEmpty, replaceError)
목차) Combine - 목차 링크 Filtering 연산자 filter // filter [1,2,3].publisher .filter { $0 % 2 == 0 } .sink(receiveValue: { print($0) }) .store(in: &cancellable) // 2 tryFilter 특정 조건에 해당하면 Error를 throw throw를 처리하는 곳은 .sink의 receiveCompletion에서 수행 주의할점은 throw가 발생하면 해당 스트림은 해제되기 때문에 3은 방출되지 않음 [1,2,-1,3].publisher .tryFilter { if $0 == -1 { throw MyError.a } else { return true } } .sink( receiveCompletion..
iOS Combine (SwiftUI)
2022. 11. 8. 22:35