

So, why did we want to get rid of this? After all, it was (for the most part) working.

Here’s a sample of what that looked like: In particular it was used to watch our reference-type model layer and respond to updates on the UI layer. Our code, before a recent refactor, was riddled with KVO. In terms of non-first-party solutions, a more recent framework is RxSwift (which our codebase also uses…and is also moving away from). In the Apple ecosystem, the longest-running and most notable is KVO. Responding to changes is not a new problem for programmers and there have been countless systems for dealing with this over time. It solves scenarios that Swift Concurrency doesn’t, such as having more than one subscriber to a stream of data, merging streams together, etc. It is heavily tied into SwiftUI, which Apple has made clear is the optimal way to build new apps (yes, this is controversial… that’s probably a topic for a different blog post). The standard Rx operators are there and have been there since its introduction. If you look at the standard API footprint of Rx-style libraries, Combine has this covered already. So, why don’t we think it’s dead and why do we think it’s safe to invest in? We aren’t concerned with the lack of updates to the framework for a few reasons: But, by knowing when to use which tool (more on this later), it’s easy to avoid conflicts between the systems and have them play nicely together. What is it not good at? Maybe its weakest point is how it integrates with other solutions - in particular, Combine doesn’t play particularly well with Swift Concurrency. It is also great at manipulating that stream of data over time, doing things like debouncing, removing duplicates, combining or merging values, and more.
#MACBOOK SWIFT PUBLISHER UPDATE#
It makes it easy to guarantee that you won’t “miss” an update by forgetting to notify a delegate somewhere. Let’s start with what Combine is built for (and good at): providing a system for responding to changes over time. Is this going to lead to architectural problems that we’ll regret? Hopefully not! During this whole saga, developers began (and continue to) speculate about whether Combine is dead, abandoned by Apple and replaced by Swift Concurrency.Īre we using more and more Combine in our codebase? Yes!Īre we using Swift Concurrency as well? Yes! Fast forward another year to WWDC 2022 and, yet again, no real Combine updates.
#MACBOOK SWIFT PUBLISHER FULL#
And, at the following WWDC in 2021, we had the first full Swift Concurrency release…and no meaningful updates to Combine. At the time, it seemed like there was quite a bit of excitement that Apple was giving us a first-party reactive programming solution.Ī year later, in October 2020, the first Swift Concurrency roadmaps appeared in the Swift forums. Apple introduced their Combine framework at the 2019 WWDC, alongside iOS 13, macOS 10.15, and, maybe most notably, SwiftUI.
