We’ll compare RxSwift and Combine thoroughly in this article. Are we going to migrate all our RxSwift code to Combine? Not really, there are a lot of pros and cons for both RxSwift and Combine. If you follow our blog, you will know that we at QuickBird Studios are big fans of functional reactive programming and therefore use RxSwift on iOS, next to RxJava on Android or Flow on Kotlin. It will bring modern coding techniques from other platforms (like the web) to the Apple platforms. Apples announcement will be a huge push for reactive programming in general. Your complicated event-processing code becomes easier to read and maintain. It allows developers to easily express (asynchronous) data flows, automatically evaluates them and propagates data changes. We should use Combine for the same reasons as people use reactive programming already. Why should we use Combine?īy adopting Combine, you’ll make your code easier to read and maintain, by centralizing your event-processing code and eliminating troublesome techniques like nested closures and convention-based callbacks. Ok, so now that we know that Combine is “just another” reactive framework, we are ready to move on and see what makes it a better or worse fit for our needs. Combine itself even implements the reactive streams specification with some small adaptions. It seems like Apple doesn’t want to give any credits to the fantastic community that build around reactive programming. There is not a single mention of it in its documentation and neither was in their WWDC presentations. Is that not the same as reactive programming? It’s funny to see Apple trying to avoid the word ‘reactive programming’. ![]() The Combine framework provides a declarative Swift API for processing values over time. What is Combine?īefore we start with the comparison, let’s take a look at how Apple answers the question of what Combine really is: In this article, we will take a deeper look at Combine and compare it to RxSwift, the current state of the art reactive framework for iOS programming. ![]() A lot of folks were seeing Combine only as an enabler for SwiftUI, but Combine also introduces first-class reactive programming to the Apple platforms without the need for external dependencies like RxSwift or ReactiveSwift. Since we humans can only focus on one new thing, all the hype was reserved for SwiftUI and people almost missed Apple’s second big announcement: Combine. ![]() Roughly one month ago Apple showcased SwiftUI at the WWDC 2019.
0 Comments
Leave a Reply. |