RxSwift course

I'll put here all RxSwift related posts!

RxSwift course - basics
For 3 years I’m working with RxSwift on daily basis. It helps a lot with data manipulation and UI binding when MVVM is your architecture of choice. The framework gives developers flexibility and extendability. I made even an Rx version of filters used in an application that was using Metal.
RxSwift course - Subjects
Last time we talked about observable and how to subscribe for values. This time I’ll show You how to make sequences more “dynamic” SubjectSubject in Rx works like an observer, you can send value to it and the subject will pass it down. RxSwift provides three basic subjects: PublishSubject -
RxSwift course - transformations: map, filter, compactMap, scan, reduce
This time we will take a look at transformations. RxSwift provides many ways to manipulate observable’s values. I’ll show you a couple of basic ones. I’ll use the same starter project. MapMap operator works exactly like the one form Swift collection types. It changes the current value into a new
RxSwift course - combining observables: merge, zip, combineLatest, withLatestFrom
RxSwift provides many ways to combine and merge two or more observables together. Sometimes more than one thing has to go right to get the desired result. Starter projectWe will reuse the starter project available here. MergeThis operator merges two observables of the same value type together. Cons…
RxSwift course - flatMap, flatMapLatest and async tasks
Working with async tasks using RxSwift is easy and straightforward. For me, the hardest thing was to grasp the concept of the flatMap operator. FlatMap - general ideaFirst, let us focus on flatMap what we can use on collections. It is converting an array of arrays to one flat array:
RxSwift course - RxCocoa and UI binding
RxCocoa brings UIKit controls and views to the reactive world. We can access them with .rx on view object. Neary all relevant properties of views have their reactive wrapper: alpha, background color, frame, visibility, and many more. There are specific extensions for labels, table views, text input,…
RxSwift course - adding RxSwift extensions to existing code - part 1
This tutorial will use all pieces of information we gathered from previous posts to refactor existing code to RxSwift. I created a base project. Simple iOS application displaying images in the collection view. Our “API” is in a separate framework to mimic app modularization. The starter is done with…
RxSwift course - adding RxSwift extensions to existing code - part 2
To finish our conversion from part 1, we will need all changes, available here. Collection viewRight now we are using old-fashioned collection view implementation, using delegate and data source. I’ll simplify this code a lot by using RxSwift and RxCocoa. Let’s refactor viewDidLoad: import RxCocoa o…