ReactiveX /RxSwift

Reactive Programming in Swift

★ 24,630⑂ 4,146👁 521⑃ 1,399● 1,297▤ 80
SwiftMITCreated 2015-04-07
下载:Kawazoi.2Kawazoi.2-6.10.2 ↓6.10.22026-03-02
+1
日增长
+2
周增长
+2
月增长
24,630
stars
4,146
forks
521
watchers
1,399
prs
1,297
issues
80
releases

README

Rx is a generic abstraction of computation expressed through Observable interface, which lets you broadcast and subscribe to values and other events from an Observable stream.

RxSwift is the Swift-specific implementation of the Reactive Extensions standard.



While this version aims to stay true to the original spirit and naming conventions of Rx, this project also aims to provide a true Swift-first API for Rx APIs.

Cross platform documentation can be found on ReactiveX.io.

Like other Rx implementations, RxSwift's intention is to enable easy composition of asynchronous operations and streams of data in the form of Observable objects and a suite of methods to transform and compose these pieces of asynchronous work.

KVO observation, async operations, UI Events and other streams of data are all unified under abstraction of sequence. This is the reason why Rx is so simple, elegant and powerful.

 I came here because I want to ...

 ... understand

 why use rx?
 the basics, getting started with RxSwift
 traits - what are Single, Completable, Maybe, Driver, and ControlProperty ... and why do they exist?
 testing
 tips and common errors
 debugging
 the math behind Rx
 what are hot and cold observable sequences?

 ... install

 Integrate RxSwift/RxCocoa with my app. Installation Guide

 ... hack around

 with the example app. Running Example App
 with operators in playgrounds. Playgrounds

 ... interact

 All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences. Join Slack Channel
 Report a problem using the library. Open an Issue With Bug Template
 Request a new feature. Open an Issue With Feature Request Template
 Help out Check out contribution guide

 ... compare

 with Combine and ReactiveSwift.

 ... understand the structure

RxSwift is as compositional as the asynchronous work it drives. The core unit is RxSwift itself, while other dependencies can be added for UI Work, testing, and more.

It comprises five separate components depending on each other in the following way:

none
┌──────────────┐    ┌──────────────┐
│   RxCocoa    ├────▶   RxRelay    │
└───────┬──────┘    └──────┬───────┘
        │                  │
┌───────▼──────────────────▼───────┐
│             RxSwift              │
└───────▲──────────────────▲───────┘
        │                  │
┌───────┴──────┐    ┌──────┴───────┐
│    RxTest    │    │  RxBlocking  │
└──────────────┘    └──────────────┘


 RxSwift: The core of RxSwift, providing the Rx standard as (mostly) defined by ReactiveX. It has no other dependencies.
 RxCocoa: Provides Cocoa-specific capabilities for general iOS/macOS/watchOS & tvOS app development, such as Shared Sequences, Traits, and much more. It depends on both RxSwift and RxRelay.
 RxRelay: Provides PublishRelay, BehaviorRelay and ReplayRelay, three simple wrappers around Subjects. It depends on RxSwift.
 RxTest and RxBlocking: Provides testing capabilities for Rx-based systems. It depends on RxSwift.

 U

Top issues

Latest release

Kawazoi.2 6.10.2 2026-03-02
This release is identical to 6.10.1 / 6.10 Kawazoi aside for fixing Mac Catalyst support and resolving a minor issues in Swift 5.9 manifest. Content-wise, 6.10.1 and 6.10 are identical.

 Breaking Changes

- CocoaPods support has been officially deprecated. This follows Cocoapods' read-only trunk notice. Please migrate to Swift Package Manager or Carthage.
- AsyncSequence.asObservable() now uses Task.detached instead of Task, aligning with how other Rx/Async bridging works. This removes a subtle foot-gun where iteration could unexpectedly inherit the calling task's actor context, potentia

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON