

The magic of observable objectsĪpart from being a stand-alone framework, Combine also plays a very important role in the declarative machinery that powers SwiftUI - especially when it comes to how the system can automatically re-render parts of our UI when its underlying data changes.Ī key part of that system is the ObservableObject protocol, which enables us to mark any class as being observable. So this week, let’s take a look at one of Combine’s more interesting aspects - published properties - and how it’s definitely possible to adopt that pattern even without access to Combine itself. However, using Combine requires us to drop support for Apple’s previous OS versions, which is many cases might be somewhat of a “deal breaker”. While it does use patterns and APIs that are very similar to other reactive frameworks, such as RxSwift and ReactiveSwift, it also makes heavy use of several new Swift features (as well as a dash of compiler magic) to make reactive programming more approachable in a few key ways. Part of the magic of Combine is that it isn’t just another reactive programming framework.

Reactive programming has become increasingly popular within the Apple developer community over the last few years, and the introduction of Apple’s own Combine framework during WWDC 2019 is likely going to further accelerate that growth in popularity for years to come.
