talira

Reactive Programming in Swift

open sourceMITfree

RxSwift is the Swift implementation of the Reactive Extensions (Rx): asynchronous work, UI events, KVO and other streams of data are all represented as Observable sequences you compose and transform with Rx's operators. It's split into modules: RxSwift itself, RxCocoa for iOS, macOS, tvOS and watchOS app development (traits like Driver and ControlProperty), RxRelay, and RxTest and RxBlocking for testing. It runs on Apple's platforms and Linux and installs with Swift Package Manager or Carthage.

Problems it solves

  • compose asynchronous operations and UI events in an iOS app without nested callbacks
  • bind UI controls to data that changes over time in a Swift app
  • use the same Rx operators in Swift that I know from RxJS or RxJava
  • test time-based asynchronous code in Swift deterministically

Features

  • Observable sequences with the standard Rx operators
  • RxCocoa bindings and traits (Driver, Signal, ControlProperty) for UIKit and AppKit
  • RxRelay for state that never errors or completes
  • RxTest and RxBlocking for testing
  • Swift Package Manager and Carthage installation