0Pricing
Swift Academy · Lesson

Transforming and Combining Streams

Use flatMap, merge, combineLatest, and zip.

Working with Streams

In Combine, a publisher emits a stream of values over time. The real power comes from operators that transform and combine these streams into new ones.

This lesson covers the most important transforming and combining operators: flatMap, merge, combineLatest, and zip.

map vs flatMap

map transforms each value into another value. flatMap goes further — it transforms each value into a new publisher and flattens the results into a single stream.

Use flatMap when each input should trigger another async operation.

All lessons in this course

  1. Transforming and Combining Streams
  2. Schedulers and Threading
  3. Error Handling Operators
  4. Custom Publishers and Subscribers
← Back to Swift Academy