[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8050":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},8050,"rxswift-to-combine-cheatsheet","CombineCommunity\u002Frxswift-to-combine-cheatsheet","CombineCommunity","RxSwift to Apple’s Combine Cheat Sheet","https:\u002F\u002Fmedium.com\u002Fgett-engineering\u002Frxswift-to-apples-combine-cheat-sheet-e9ce32b14c5b",null,"Ruby",2087,129,37,5,0,1,28.34,"MIT License",false,"master",true,[24,25,26,27,28,29],"apple","combine","reactive","reactive-programming","rxswift","swiftui","2026-06-12 02:01:48","# RxSwift to Combine Cheatsheet\nThis is a Cheatsheet for [RxSwift](https:\u002F\u002Fgithub.com\u002FReactiveX\u002FRxSwift) developers interested in Apple's new [Combine](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcombine) framework.\n\nIt's based on the following blog post: [https:\u002F\u002Fmedium.com\u002Fgett-engineering\u002Frxswift-to-apples-combine-cheat-sheet-e9ce32b14c5b](https:\u002F\u002Fmedium.com\u002Fgett-engineering\u002Frxswift-to-apples-combine-cheat-sheet-e9ce32b14c5b)\n\n## [Basics](Data\u002Fbasics.csv)\n\n|                       | RxSwift                          | Combine                                    |\n|-----------------------|----------------------------------|--------------------------------------------|\n| Deployment Target     | iOS 8.0+                         | iOS 13.0+                                  |\n| Platforms supported   | iOS, macOS, tvOS, watchOS, Linux | iOS, macOS, tvOS, watchOS, UIKit for Mac ¹ |\n| Spec                  | Reactive Extensions (ReactiveX)  | Reactive Streams (+ adjustments)           |\n| Framework Consumption | Third-party                      | First-party (built-in)                     |\n| Maintained by         | Open-Source \u002F Community          | Apple                                      |\n| UI Bindings           | RxCocoa                          | SwiftUI ²                                  |\n\n\n## [Core Components](Data\u002Fcore_components.csv)\n\n| RxSwift                   | Combine                         | Notes                                                                                                                                                           |\n|---------------------------|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| AnyObserver               | AnySubscriber                   |                                                                                                                                                                 |\n| BehaviorRelay             | ❌                               | Simple wrapper around BehaviorSubject, could be easily recreated in Combine                                                                                     |\n| BehaviorSubject           | CurrentValueSubject             | This seems to be the type that holds @State under the hood                                                                                                      |\n| Completable               | ❌                               |                                                                                                                                                                 |\n| CompositeDisposable       | ❌                               |                                                                                                                                                                 |\n| ConnectableObservableType | ConnectablePublisher            |                                                                                                                                                                 |\n| Disposable                | Cancellable                     |                                                                                                                                                                 |\n| DisposeBag                | A collection of AnyCancellables | Call anyCancellable.store(in: &collection), where collection can be an array, a set, or any other RangeReplaceableCollection                                    |\n| Driver                    | ObservableObject                | Both guarantee no failure, but Driver guarantees delivery on Main Thread. In Combine, SwiftUI recreates the entire view hierarachy on the Main Thread, instead. |\n| Maybe                     | Optional.Publisher              |                                                                                                                                                                 |\n| Observable                | Publisher                       |                                                                                                                                                                 |\n| Observer                  | Subscriber                      |                                                                                                                                                                 |\n| PublishRelay              | ❌                               | Simple wrapper around PublishSubject, could be easily recreated in Combine                                                                                      |\n| PublishSubject            | PassthroughSubject              |                                                                                                                                                                 |\n| ReplaySubject             | ❌                               |                                                                                                                                                                 |\n| ScheduledDisposable       | ❌                               |                                                                                                                                                                 |\n| SchedulerType             | Scheduler                       |                                                                                                                                                                 |\n| SerialDisposable          | ❌                               |                                                                                                                                                                 |\n| Signal                    | ❌                               |                                                                                                                                                                 |\n| Single                    | Deferred + Future               | Future has to be wrapped in a Deferred, or its greedy as opposed to Single's laziness                                                                           |\n| SubjectType               | Subject                         |                                                                                                                                                                 |\n| TestScheduler             | ❌                               | There doesn't seem to be an existing testing scheduler for Combine code                                                                                         |\n\n\n## [Operators](Data\u002Foperators.csv)\n\n| RxSwift               | Combine                                  | Notes                                                                                                    |\n|-----------------------|------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| allSatisfy            | allSatisfy                               |                                                                                                          |\n| amb()                 | ❌                                        |                                                                                                          |\n| asObservable()        | eraseToAnyPublisher()                    |                                                                                                          |\n| asObserver()          | ❌                                        |                                                                                                          |\n| bind(to:)             | `assign(to:on:)`                         | Assign uses a KeyPath which is really nice and useful. RxSwift needs a Binder \u002F ObserverType to bind to. |\n| buffer                | buffer                                   |                                                                                                          |\n| catch                 | catch                                    |                                                                                                          |\n| catchAndReturn        | replaceError(with:)                      |                                                                                                          |\n| combineLatest         | combineLatest, tryCombineLatest          |                                                                                                          |\n| compactMap            | compactMap, tryCompactMap                |                                                                                                          |\n| concat                | append, prepend                          |                                                                                                          |\n| concatMap             | ❌                                        |                                                                                                          |\n| contains              | contains                                 |                                                                                                          |\n| count                 | count                                    |                                                                                                          |\n| create                | ❌                                        | Apple removed AnyPublisher with a closure in Xcode 11 beta 3 :-(                                         |\n| debounce              | debounce                                 |                                                                                                          |\n| debug                 | print                                    |                                                                                                          |\n| deferred              | Deferred                                 |                                                                                                          |\n| delay                 | delay                                    |                                                                                                          |\n| delaySubscription     | ❌                                        |                                                                                                          |\n| dematerialize         | ❌                                        |                                                                                                          |\n| distinctUntilChanged  | removeDuplicates, tryRemoveDuplicates    |                                                                                                          |\n| do                    | handleEvents                             |                                                                                                          |\n| element(at:)          | output(at:)                              |                                                                                                          |\n| empty                 | Empty(completeImmediately: true)         |                                                                                                          |\n| enumerated            | ❌                                        |                                                                                                          |\n| error                 | Fail                                     |                                                                                                          |\n| filter                | filter, tryFilter                        |                                                                                                          |\n| first                 | first, tryFirst                          |                                                                                                          |\n| first(where:)         | first(where:), tryFirst(where:)          |                                                                                                          |\n| flatMap               | flatMap                                  |                                                                                                          |\n| flatMapFirst          | ❌                                        |                                                                                                          |\n| flatMapLatest         | switchToLatest                           |                                                                                                          |\n| from(optional:)       | Optional.Publisher(_ output:)            |                                                                                                          |\n| groupBy               | ❌                                        |                                                                                                          |\n| ifEmpty(default:)     | replaceEmpty(with:)                      |                                                                                                          |\n| ifEmpty(switchTo:)    | ❌                                        | Could be achieved with composition - replaceEmpty(with: publisher).switchToLatest()                      |\n| ignoreElements        | ignoreOutput                             |                                                                                                          |\n| interval              | ❌                                        |                                                                                                          |\n| just                  | Just                                     |                                                                                                          |\n| last(where:)          | last(where:), tryLast(where:)            |                                                                                                          |\n| map                   | map, tryMap                              |                                                                                                          |\n| materialize           | ❌                                        |                                                                                                          |\n| max                   | max                                      |                                                                                                          |\n| merge                 | merge, tryMerge                          |                                                                                                          |\n| merge(maxConcurrent:) | flatMap(maxPublishers:)                  |                                                                                                          |\n| min                   | min                                      |                                                                                                          |\n| multicast             | multicast                                |                                                                                                          |\n| never                 | Empty(completeImmediately: false)        |                                                                                                          |\n| observe(on:)          | receive(on:)                             |                                                                                                          |\n| of                    | Sequence.publisher                       | `publisher` property on any `Sequence` or you can use `Publishers.Sequence(sequence:)` directly          |\n| publish               | makeConnectable                          |                                                                                                          |\n| range                 | ❌                                        |                                                                                                          |\n| reduce                | reduce, tryReduce                        |                                                                                                          |\n| refCount              | autoconnect                              |                                                                                                          |\n| repeatElement         | ❌                                        |                                                                                                          |\n| retry(when:)          | ❌                                        |                                                                                                          |\n| retry, retry(3)       | retry, retry(3)                          |                                                                                                          |\n| sample                | ❌                                        |                                                                                                          |\n| scan                  | scan, tryScan                            |                                                                                                          |\n| share                 | share                                    | There’s no replay or scope in Combine. Could be “faked” with multicast.                                  |\n| skip(3)               | dropFirst(3)                             |                                                                                                          |\n| skip(until:)          | drop(untilOutputFrom:)                   |                                                                                                          |\n| skip(while:)          | drop(while:), tryDrop(while:)            |                                                                                                          |\n| startWith             | prepend                                  |                                                                                                          |\n| subscribe             | sink                                     |                                                                                                          |\n| subscribe(on:)        | subscribe(on:)                           | RxSwift uses Schedulers. Combine uses RunLoop, DispatchQueue, and OperationQueue.                        |\n| take(1)               | prefix(1)                                |                                                                                                          |\n| take(until:)          | prefix(untilOutputFrom:)                 |                                                                                                          |\n| take(while:)          | prefix(while:), tryPrefix(while:)        |                                                                                                          |\n| takeLast              | last                                     |                                                                                                          |\n| throttle              | throttle                                 |                                                                                                          |\n| timeInterval          | measureInterval                          |                                                                                                          |\n| timeout               | timeout                                  |                                                                                                          |\n| timer                 | Timer.publish                            |                                                                                                          |\n| toArray()             | collect()                                |                                                                                                          |\n| window                | collect(Publishers.TimeGroupingStrategy) | Combine has a TimeGroupingStrategy.byTimeOrCount that could be used as a window.                         |\n| withLatestFrom        | ❌                                        |                                                                                                          |\n| zip                   | zip                                      |                                                                                                          |\n\n\n# Contributing\nAdd any data\u002Foperators to the appropriate CSV files in the **Data** folder, run `bundle install` and `generate.rb`.\n\nFinally, commit the changes and submit a Pull Request.","该项目提供了一份从RxSwift迁移到Apple的Combine框架的速查表，旨在帮助开发者快速理解和转换代码。它详细对比了RxSwift与Combine在基础特性、核心组件等方面的异同，比如部署目标、支持平台以及UI绑定方式等，并指出了两者之间的对应关系和差异点。适合于正在考虑或已经决定将现有基于RxSwift的应用迁移到Combine框架下的iOS\u002FmacOS开发者使用，尤其是那些希望利用苹果原生技术栈优势进行开发的人士。",2,"2026-06-11 03:15:50","top_language"]