This is Understanding Combine, written by Matt Neuburg. Corrections and suggestions are greatly appreciated (you can comment here). So are donations; please consider keeping me going by funding this work at http://www.paypal.me/mattneub. Or buy my books: the current (and final) editions are iOS 15 Programming Fundamentals with Swift and Programming iOS 14. Thank you!
Subscribers
A Combine pipeline is built from a publisher, some operators, and a subscriber. We’re now ready to talk about the details and describe what publishers, operators, and subscribers exist, built in to the framework. (You can also write your own publishers, operators, and subscribers, but in real life you’re not very likely to need to do that.)
I’m going to start with the subscribers. This might seem backwards, but there are only a couple of built-in subscribers and they are extremely simple, so we may as well get them out of the way.
I’ll also talk about what it would take to write your own subscriber. It isn’t very likely that you’d need to do that, but if you do, a rudimentary subscriber is not difficult to write.