Step into Swift logo

What is the WithLatestFrom Operator in RxSwift?

WithLatestFrom Operator

RxSwift: WithLatestFrom Operator


  • Combines the emission of multiple Observables via a supplied function by combining each element from self with the latest element from the second source.
  • When self emits an element, it will combine with the latest from the second Observable.
  • If self emits and the second Observable does not have a value yet, nothing will emit.
  • Useful for user interfaces. Say, tap plus the latest value in a UITextField.
  • Similar to the sample operator only, with withLatestFrom takes data as a parameter.



< All Posts