RxSwift is the Swift member of the ReactiveX family, the same reactive programming model available in many other languages, such as RxJava and RxJS. It treats events, user input, and network responses as observable sequences that you transform and combine with operators.
RxSwift came years before Apple’s Combine, and it’s still in many production apps. Even if you start new projects with Combine or Swift concurrency, knowing RxSwift will help you work with existing codebases, and the concepts transfer almost one to one.
Each article measures the behavior it describes and ends with an exercise. The examples use RxSwift 6.10.2 in Swift 6 language mode and were compiled and run with the Swift 6.4 toolchain from Xcode 27.1 on macOS 26, so they also show where RxSwift, a library compiled without strict concurrency checking, meets Swift 6’s actor isolation: which closures crash when a chain delivers on a background thread, and how to write chains that do not. Time-based behavior is measured on RxTest’s virtual clock, set up in the filtering article; the RxCocoa and MVVM examples ran against real UIKit controls in the iOS simulator; and the testing article is a Swift package run with swift test.
Article available Coming soon
1. Observables
Observables and Observers
An array is a sequence you pull from: you ask for the next element, and it is there or it is not....
Creating Observables: just, of, from, and create
Every RxSwift chain starts with a source. Most of the time the source comes from a library: RxCocoa gives you the text...
Subscribing
An observable is a description of work, and subscribe is the call that starts it. It is also where most RxSwift bugs...
Disposing and DisposeBag
Every subscription has a lifetime, and RxSwift asks you to decide what it is. A subscription to a network request should end...
2. Subjects and Relays
PublishSubject
Observables built with create or of are cold and closed: the producer is inside them, and the only way in is to...
BehaviorSubject
A PublishSubject is for events: a subscriber that arrives late has missed them, and that is correct, because a tap that happened...
ReplaySubject
A PublishSubject forgets everything, and a BehaviorSubject remembers exactly one value. Some subscribers need more. A chat screen opened in the middle...
AsyncSubject
The three subjects so far differ in how much of the past they hand to a new subscriber: nothing, the current value,...
Relays: PublishRelay and BehaviorRelay
Subjects have a flaw for UI work: they can end. One onCompleted() from anywhere, or one error that reaches a subject through...
3. Traits
Single, Maybe, and Completable
An Observable<User> returned by fetchUser(id:) says very little. It might emit one user and complete, which is what the author meant. It...
Driver and Signal
Binding an observable to the UI has three requirements that ordinary observables do not meet. The UI must be updated on the...
4. Operators
Filtering Operators: filter, distinctUntilChanged, skip, take
Most streams in an app carry more than their subscribers need. A scroll view reports its offset on every frame, and a...
Time Operators: debounce, throttle, delay, interval, timer, timeout
Time is where reactive code earns its keep. Waiting until the user stops typing before searching, ignoring the second tap of an...
Transforming Operators: map, flatMap, flatMapLatest, concatMap
map turns each element into another element. That covers formatting a date, extracting a field, or computing a total, and it is...
Combining Operators: combineLatest, zip, merge, concat, withLatestFrom
Screens rarely depend on one stream. A sign-up button is enabled when the email is valid and the password is long enough...
5. Errors and Threading
Error Handling: catch, catchAndReturn, and retry
An error in RxSwift is not an exception that a caller can catch and move past. It is the last event of...
Schedulers: observe(on:) and subscribe(on:)
RxSwift does not choose threads. As Observables and Observers measured, a chain is a set of nested function calls, and events travel...
6. RxSwift in Apps
RxCocoa: Binding Observables to UIKit
RxSwift on its own knows nothing about buttons, text fields, or table views. RxCocoa is the library that connects the two: it...
MVVM with RxSwift
Model-View-ViewModel is the architecture most RxSwift apps use, and RxSwift is a large part of why. The view model holds the screen’s...
Writing Custom Reactive Extensions
RxCocoa covers UIKit’s controls, but every app has types RxCocoa has never heard of: a custom rating control, a download manager with...
Testing with RxTest and RxBlocking
Reactive code is about when: when a debounced query fires, when a stale request is cancelled, when a retry happens, in what...
Up next
More Swift Topics