O'Reilly logo

Reactive Programming with Swift 4 by Navdeep Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing zip

The zip operator lets you combine sequences of different types and apply transformations to zip them together. It will combine up to eight Observable sequences into a single sequence and will wait to emit elements from each one of the other source Observable sequences at an index until they all have emitted elements at that index. The following diagram expresses the functionality of zip briefly:

If you are developing a card game and want to wait until each player was done with the full hand before continuing, you can use zip. Why do you think we need a zip operator for a card game?

Here's the answer—as some of you might have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required