Step into Swift logo

What is the bindTo operator in RxCocoa?

BindTo Operator

RxSwift: BindTo

  • Special and tailored version of subscribe
  • No side effects or special cases
  • Bind user interface to underlying data and other things such as a certain observable triggering a subject to perform a background task.
  • To bind an observer to another entity, the receiver must conform to observer type. i.e: a Subject that can process values but also written to.
result.map { "\($0.score)" }
      .bindTo(scoreLabel.rx.text)
      .addDisposableTo(disposeBag)

< All Posts