Repolode
ReactiveX

ReactiveX/RxSwift

A Swift implementation of Reactive Extensions (Rx) for composing asynchronous events and data streams via Observable sequences.

Stars
24,627
Forks
4,147
Open issues
19
Last commit
2 months ago

What is it?

RxSwift brings the Reactive Extensions (ReactiveX) model to Swift. It represents asynchronous work, UI events, KVO observations and other data streams as Observable sequences, which can be transformed, filtered and combined with a large set of operators, and subscribed to for their values and completion events.

The project is split into several modules. RxSwift is the core with no external dependencies. RxCocoa adds Cocoa-specific helpers for iOS, macOS, tvOS and watchOS, such as bindings for UIKit and AppKit controls and shared sequences and traits like Driver. RxRelay provides PublishRelay, BehaviorRelay and ReplayRelay, while RxTest and RxBlocking support testing Rx-based code.

RxSwift can be installed with Swift Package Manager, Carthage, XCFrameworks or git submodules. The repository includes an example app and documentation covering getting started, traits, testing and common pitfalls.

Key features

  • 01Observable sequences unify async operations, UI events and KVO streams.
  • 02A broad set of operators for transforming, filtering and combining streams.
  • 03RxCocoa provides bindings and shared sequences for Apple UI frameworks.
  • 04RxRelay offers PublishRelay, BehaviorRelay and ReplayRelay wrappers around subjects.
  • 05RxTest and RxBlocking support testing Rx-based code.
  • 06Installable via Swift Package Manager, Carthage or XCFrameworks.

Use cases

  • Binding network search results to a table view with debouncing and cancellation.
  • Combining multiple asynchronous API calls into a single reactive pipeline in an iOS app.
  • Driving UI state from user input and model changes in MVVM-style architectures.
  • Writing unit tests for asynchronous stream logic using RxTest.

Quick start

  1. 1

    Add RxSwift as a dependency in Package.swift

  2. 2

    Build the project with Swift Package Manager

    swift build

Things to know

  • The README notes an unresolved Swift Package Manager cross-dependency bug (SR-12303) that may affect builds.

In collections

Topics

#reactive-programming#swift#ios#functional-programming#observable#async#rxswift#functional#observer#reactive

FAQ

What is RxSwift?
A Swift implementation of Reactive Extensions (Rx) for composing asynchronous events and data streams via Observable sequences. RxSwift brings the Reactive Extensions (ReactiveX) model to Swift. It represents asynchronous work, UI events, KVO observations and other data streams as Observable sequences, which can be transformed, filtered and combined with a large set of operators, and subscribed to for their values and completion events.
Is RxSwift free to use? What license does it have?
RxSwift is open source under the MIT license. Check the license terms before using it in commercial products.
Is RxSwift still maintained?
Updated within 6 months. The last commit to RxSwift was on Sep 4, 2026.
What can I use RxSwift for?
Binding network search results to a table view with debouncing and cancellation. Combining multiple asynchronous API calls into a single reactive pipeline in an iOS app. Driving UI state from user input and model changes in MVVM-style architectures. Writing unit tests for asynchronous stream logic using RxTest.
How do I install RxSwift?
Add RxSwift as a dependency in Package.swift Build the project with Swift Package Manager: swift build
Where can I get RxSwift?
The source code and installation instructions are on GitHub: https://github.com/ReactiveX/RxSwift

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects