0Pricing
Swift Academy · Lesson

Publishers and Subscribers

The Publisher/Subscriber contract, sink and assign built-in subscribers.

Welcome

Combine is Apple's reactive framework. At its core are Publishers (produce values) and Subscribers (consume them).

Publisher Protocol

A `Publisher` emits values over time and eventually completes or fails: ```swift publisher .sink { print("Received: \($0)") } ``` The `Output` type is the value type; `Failure` is the error type.

All lessons in this course

  1. Publishers and Subscribers
  2. Operators: map, filter, combineLatest
  3. PassthroughSubject and CurrentValueSubject
  4. Networking with Combine and URLSession
← Back to Swift Academy