[RxSwift] toArray, map, flatMap, flatMapLatest
toArray let disposeBag = DisposeBag() Observable.of(1, 2, 3, 4, 5) .toArray() .subscribe({ print($0) }).disposed(by: disposeBag) //success([1, 2, 3, 4, 5]) toArray는 배열로 만들어줍니다. Map let disposeBag = DisposeBag() Observable.of(1, 2, 3, 4, 5) .map { $0 * 2 } .subscribe(onNext: { print($0) }).disposed(by: disposeBag) //2 //4 //6 //8 //10 Map은 새로운 이벤트로 변경해줍니다. 예시 self.myTextField.rx.controlEvent(.edi..
Swift
2020. 12. 23. 14:20
공지사항