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 |
Tags
- clean architecture
- 스위프트
- 클린 코드
- Refactoring
- Observable
- MVVM
- tableView
- uiscrollview
- collectionview
- 리펙토링
- swift documentation
- map
- Protocol
- Clean Code
- combine
- UITextView
- uitableview
- UICollectionView
- 리팩토링
- 애니메이션
- ribs
- swiftUI
- RxCocoa
- Human interface guide
- HIG
- SWIFT
- rxswift
- 리펙터링
- ios
- Xcode
Archives
- Today
- Total
목록tryCompactMap (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