In this tutorial, you learn how to combine and chain publishers in Combine with Publishers.Zip and flatMap().

What if a HTTP network request depends on the response of another? In this tutorial, we’ll discuss how you can parallelize and/or serialize networking tasks with Combine.

Here’s what we’ll get into:

  • Combining multiple Combine publishers in Swift
  • Working with Publishers``.``Zip and flatMap()
  • How subscribers and publishers work in Combine
  • Getting to know Combine’s generics and types
  • Working with JSON and Codable with Combine
  • Making network requests with Combine and URLSession
  • Getting to know various Combine operators, like map``()
  • Practical use cases for combining and chaining publishers

Ready? Let’s go.

  1. Why Combine Multiple HTTP Requests?
  2. Working with Combine in Swift
  3. Combining Publishers with Publishers.Zip
  4. Chaining Publishers with flatMap()
  5. Wrapping Up
  6. Further Reading

#swift #mobile-apps #programming #developer

Combining Network Requests with Combine and Swift
19.45 GEEK