Functional Reactive Programming
SwiftUI and Combine: Better Together
Why SwiftUI and Combine will help you to build better apps
One of the biggest announcements at WWDC 2019 was SwiftUI — its declarative approach makes building UIs a breeze, and it’s easy to see why people are so excited about it. The hidden gem, however, was the Combine framework, which didn’t get as much fanfare as I think it deserves.
Apple have put their sign of approval on Functional Reactive Programming, and soon it will no longer be a technique that only a few development teams use.
In this article, we will take a closer look at how to use SwiftUI and Combine together, build better apps, and have more fun along the way.
Ready? Let’s go!
What you are going to learn
- What the Combine framework is, and how to integrate it with SwiftUI
- What publishers, subscribers, and operators are, and how to use them
- How to organize your code
To help us reason about SwiftUI and Combine, we’re going to use a simple sign-up screen that lets users enter a…