Skip to content

RxSwift

A Swift implementation of Reactive Extensions for handling streams of asynchronous events.

Stars
24.6k
Forks
4.1k
Licence
MIT
Language
Swift
Last update
2 months ago
Type
Library

What it is

RxSwift brings the Reactive Extensions (Rx) approach to Swift. It wraps asynchronous work, such as network responses, UI events, and value changes, in Observable sequences that you can subscribe to and transform with operators. The README says it is meant to combine Rx's naming conventions with a more Swift-first API.

  • Debounce a search text field and run a network request on each settled query, as shown in the README example
  • Bind an array of results to a table view with tableView.rx.items
  • Combine KVO observations, UI events, and async operations into one stream

Great for

  • Swift developers building iOS, macOS, tvOS, or watchOS apps who already handle many asynchronous events
  • Teams that want to bind UI elements such as text fields and table views to data streams
  • Developers who want to write tests for asynchronous code using RxTest or RxBlocking

Not ideal for

  • Developers who only need simple, one-off async calls; the README describes Rx as a larger abstraction to learn, so basic async/await or Combine may be simpler
  • Projects that need the latest Swift tooling without caveats, since the README notes an open Swift Package Manager cross-dependency bug (SR-12303)
Step-by-step guide: how to use RxSwiftInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Xcode or a Swift toolchain with Swift Package Manager, Carthage, or manual xcframework setup

    Add to Cartfile (Carthage)

    github "ReactiveX/RxSwift" "6.10.0"

    Update Carthage dependencies

    carthage update
  2. 2

    Run it

    • Pick an install method from the README: Swift Package Manager, Carthage, or XCFrameworks
    • Open Rx.xcworkspace and run the RxExample target to see a working sample app
    • Read Documentation/GettingStarted.md for the basics of Observables
    • Try operators in a playground using Documentation/Playgrounds.md
  3. 3

    Get the most out of it

    • Read Documentation/Traits.md to learn when Single, Completable, Maybe, and Driver fit better than plain Observable
    • Use RxTest and RxBlocking to unit test your streams, per Documentation/UnitTests.md
    • Use RxRelay's PublishRelay, BehaviorRelay, and ReplayRelay for simple subject-like wrappers
    • Read Documentation/HotAndColdObservables.md to understand subscription timing

Downloads

Strengths

  • Large, established project with 24k+ stars and an MIT license
  • Documentation covers basics, traits, testing, and debugging
  • Modular: RxSwift core has no dependencies, and extras like RxCocoa and RxTest are optional

Trade-offs

  • The README describes Rx concepts as a learning curve; the docs include guides on hot and cold observables and common errors
  • The README flags a known Swift Package Manager bug affecting RxSwift, with only a partial workaround

How it compares

ProjectStarsTypeLevelUpdatedBest for
RxSwift (this)24.6kLibraryintermediate2 months agoSwift developers building iOS, macOS, tvOS, or watchOS apps who already handle many asynchronous events
SDWebImage25.6kLibraryintermediate7 months agoiOS or macOS app developers who need to show remote images in lists or grids
Kingfisher24.4kLibrarybeginner4 days agoiOS or macOS developers who need to show remote images in lists or detail screens
Moya15.4kLibraryintermediate4 months agoSwift developers building iOS or macOS apps that call web APIs
SwifterSwift15.3kLibrarybeginner4 days agoSwift developers building iOS or macOS apps who want common helper methods ready to use
SkeletonView12.9kLibrarybeginner5 months agoiOS developers building apps that load data from the network

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.