Migration from RxSwift 1.9 to RxSwift 2.0
- Find replace all to
.
- Find replace all
variable
toshareReplay(1)
- Find replace all
catch
tocatchErrorJustReturn
- Find replace all
failWith
toObservable.error
- Find replace all to
Observable.never
- Find replace all
empty
toObservable.empty
- We’ve moved from free functions to extensions so it’s now ,
.merge()
, … instead ofconcat([a, b, c])
,merge(sequences)
- Similarly, it’s now
subscribe { n in ... }.addDisposableTo(disposeBag)
instead of>- disposeBag.addDisposable
- The method
next
onVariable
is nowvalue
setter
If you have any doubts about how some concept in RxSwift 2.0 works, check out the Example app or playgrounds.