Step into Swift logo

What is the CombineLatest Operator in RxSwift?

CombineLatest Operator

RxSwift: CombineLatest Operator


  • Combine the latest values from each supplied Observable using a supplied function.
  • Both Observables need to emit an element for combining to happen.
  • Operator receives a closure predicate that is applied to each emitted element.
  • The latest elements from each Observable are combined.
  • You can combine sequences of heterogenous types - Only core operator that allows this.
  • Can use startWith(n) to kick things off.
  • Only completes when the last of its inner sequences completes.
  • Multiple variants taking between 2 and 8 Observable sequences as parameters - One that takes an array.

combineLatest((x, y) => "" + x + y)


< All Posts