RxCocoa

Development/iOS

[iOS] RxCocoa

RxCocoa란 Reactive한 형태를 Cocoa Framework에서도 사용할 수 있도록 하는 것을 말한다. Cocoa Framework에는 Foundation, ApplicationKit(or UIKit) 등이 있다. 1. Binder 다음 도식을 살펴보자. 여기서 핵심은 데이터가 단방향으로 흐를 수 있도록 한다는 것이다. UITextField에 글자를 쓰면 UILabel에 실시간으로 업데이트 되는 화면을 구현한다고 해보자. RxCocoa의 .bind(to: )를 사용하지 않는다면 다음과 같이 RxSwift만을 활용해 구현할 수 있다. textField.rx.text .observe(on: MainScheduler.instance) .subscribe(onNext: { label.text = $0 ..

EUNJI HA
'RxCocoa' 태그의 글 목록