Chapter 13: Working with the Combine Framework
With the launch of Combine, Apple provided developers with a new way of handling events in their code; a functional and declarative approach, where developers can implement streams and publisher/subscriber paradigms easily, without the need for external libraries. Centralizing event processing in your apps with the help of Combine makes your code easier to understand than using other traditional methods like nested closures or callbacks all around your code.
In this chapter, you will learn about the following topics:
- Understanding the Combine framework: We will review the basic components of the framework with code samples – publishers, subscribers, subjects, and operators.
- Combining publishers, subscribers, and operators: We will build a small feature in an example app mixing all these concepts together.
- Using operators to build error-proof streams: We will use
flatMap
andcatch
to create streams that can deal...