How reactivex/rxswift works
RxSwift is a Swift reactive-programming library: callers turn asynchronous work and events into observable sequences, compose them with operators and schedulers, then subscribe or bind results. RxCocoa adapts Cocoa/UI events and bindings; RxRelay supplies subject-backed relays; RxBlocking and RxTest provide testing-oriented consumption and virtual-time tools. The example app demonstrates geolocation and image-loading workflows, including reachability-aware retries and sectioned-data differencing. Most relationships below follow explicit README statements or shown source references; unsampled implementation details are not inferred.
Main entry points: Observable.swift Observable Streams · iOS UI Wrappers · Diff.swift Section Differencing · ImageService.swift Image Service
Components 27
Reactive Core
- Observable Streams
RxSwift/Observable.swift - Stream Operators
RxSwift/Observables - Subjects
RxSwift/Subjects - Schedulers
RxSwift/Schedulers - Disposal
RxSwift/Disposables - Primitive Traits
RxSwift/Traits/PrimitiveSequence
Cocoa Integration
- UI Wrappers
RxCocoa/iOS - Delegate Proxies
RxCocoa/Common/DelegateProxyType.swift - Shared Sequences
RxCocoa/Traits/SharedSequence/SharedSequence.swift - URLSession Adapter
RxCocoa/Foundation/URLSession+Rx.swift
Supporting APIs
- Relays
RxRelay - Blocking API
RxBlocking/BlockingObservable.swift - Virtual-Time Testing
RxTest/Schedulers/TestScheduler.swift
Example App
- Location Adapter
RxExample/Extensions/CLLocationManager+Rx.swift - Location Proxy
RxExample/Extensions/RxCLLocationManagerDelegateProxy.swift - Geolocation Service
RxExample/RxExample/Services/GeolocationService.swift - Image Service
RxExample/RxExample/Services/ImageService.swift - Reachability Service
RxExample/RxExample/Services/ReachabilityService.swift - Reachability Monitor
RxExample/RxExample/Services/Reachability.swift - Activity Indicator
RxExample/RxExample/Services/ActivityIndicator.swift - Image Result
RxExample/RxExample/Services/DownloadableImage.swift
Sectioned Data
- Section Differencing
RxExample/RxDataSources/Differentiator/Diff.swift - Section Identity
RxExample/RxDataSources/Differentiator/AnimatableSectionModelType.swift - Changesets
RxExample/RxDataSources/Differentiator/Changeset.swift - Item Paths
RxExample/RxDataSources/Differentiator/ItemPath.swift - Identity Types
RxExample/RxDataSources/Differentiator/IdentifiableType.swift
Other components
- Application
Connections 24
- Application → Observable Streams: creates streams
README.md - Observable Streams → Stream Operators: composes with
README.md - Application → UI Wrappers: observes UI
README.md - UI Wrappers → Delegate Proxies: wraps delegates
RxCocoa/iOS/NSTextStorage+Rx.swift - UI Wrappers → Shared Sequences: binds sequences
README.md - UI Wrappers → URLSession Adapter: adapts requests
- Observable Streams → Schedulers: schedules work
README.md - Observable Streams → Disposal: manages subscriptions
README.md - Observable Streams → Subjects: emits events
README.md - Observable Streams → Primitive Traits: specializes streams
README.md - Relays → Observable Streams: depends on
README.md - UI Wrappers → Relays: depends on
README.md - Blocking API → Observable Streams: depends on
README.md - Virtual-Time Testing → Observable Streams: depends on
README.md - Geolocation Service → Location Adapter: observes locations
RxExample/RxExample/Services/GeolocationService.swift - Location Adapter → Location Proxy: uses proxy
RxExample/Extensions/CLLocationManager+Rx.swift - Image Service → Reachability Service: retries by reachability
RxExample/RxExample/Services/ImageService.swift - Image Service → Activity Indicator: tracks loading
RxExample/RxExample/Services/ImageService.swift - Image Service → Image Result: emits image result
RxExample/RxExample/Services/ImageService.swift - Reachability Service → Reachability Monitor: starts monitor
RxExample/RxExample/Services/ReachabilityService.swift - Section Differencing → Section Identity: diffs sections
RxExample/RxDataSources/Differentiator/Diff.swift - Section Differencing → Item Paths: tracks item paths
RxExample/RxDataSources/Differentiator/Diff.swift - Section Differencing → Identity Types: indexes identities
RxExample/RxDataSources/Differentiator/Diff.swift - Section Differencing → Changesets: generates changesets
RxExample/RxDataSources/Differentiator/Diff.swift