Different types of subject

There are four different types of subject: PublishSubject, BehaviorSubject, ReplaySubject, and Variable, as discussed earlier. In this section, we will work with all of them in code, starting with PublishSubject, and gradually work our way to explain other subjects as well. You will understand when to use any particular type of subject while working with Observables and subscriptions depending on the respective requirements.

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.