Step into Swift logo

What is the TakeWhile Operator in RxSwift?

TakeWhile Operator

RxSwift: TakeWhile Operator

TakeWhile { predicate }

  • Receives a predicate and takes everything up until the predicate is false and then does not let anything through.
  • true = take
  • false = don’t take
----7--9-----1--4---->

takeWhile { x != 1}

----7--9------------->

< All Posts