From the course: Learning Combine with Swift

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Work with custom publishers and subscribers

Work with custom publishers and subscribers - Swift Tutorial

From the course: Learning Combine with Swift

Start my 1-month free trial

Work with custom publishers and subscribers

- There are times when your built-in publishers, operators and subscribers won't do. With Combine being a relatively new framework, you'll end up finding missing features and functionalities. We should expect Apple to bridge that gap over the next few years, but in the meantime, Apple has at least given us the tools to create our own custom publishers and subscribers. This is a relatively advanced topic which we will explore in a brief and higher level. Let's begin. First, let's recap the publisher and subscriber interaction workflow again. It's important before we look at creating a more advanced custom publisher and subscriber that we understand this. First, the subscriber subscribes to the publisher. The publisher then creates a subscription instance via the received subscription. The subscriber then requests values by setting demand through a subscription request method. Subscription then emits in response values back…

Contents