Chapter 9: Driving SwiftUI with Combine
In this chapter, we'll learn how to manage the state of SwiftUI Views using Combine. In the Worldwide Developers Conference (WWDC) 2019, Apple not only introduced SwiftUI but also introduced Combine, a perfect companion to SwiftUI for managing the declarative change of state in Swift.
In recent years, given the success of Functional Reactive Programming (FRP) in different sectors of the industry, the same concept has started to be used in the iOS ecosystem, firstly with ReactiveCocoa, the original framework in Objective-C, then in porting ReactiveSwift, and then RxSwift, which is the Swift implementation of ReactiveX, an umbrella of frameworks in different languages that have the same interfaces and functionalities.
In a typical Apple way, Apple took the best practices matured over years of trial and error from the community, and instead of acquiring either ReactiveSwift or RxSwift, Apple decided to reimplement the concepts, simplify...