<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Publishers/Zip",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO3ZipV"
  },
  "title" : "Publishers.Zip"
}
-->

# Publishers.Zip

A publisher created by applying the zip function to two upstream publishers.

```
struct Zip<A, B> where A : Publisher, B : Publisher, A.Failure == B.Failure
```

## Overview

Use `Publishers.Zip` to combine the latest elements from two publishers and emit a tuple to the downstream. The returned publisher waits until both publishers have emitted an event, then delivers the oldest unconsumed event from each publisher together as a tuple to the subscriber.

Much like a zipper or zip fastener on a piece of clothing pulls together rows of teeth to link the two sides, `Publishers.Zip` combines streams from two different publishers by linking pairs of elements from each side.

If either upstream publisher finishes successfully or fails with an error, so too does the zipped publisher.

## Topics

### Creating a zip publisher

[`init(_:_:)`](/documentation/Combine/Publishers/Zip/init(_:_:))

Creates a publisher that applies the zip function to two upstream publishers.

### Declaring supporting types

[`Publishers.Zip.Output`](/documentation/Combine/Publishers/Zip/Output)

The kind of values published by this publisher.

[`Publishers.Zip.Failure`](/documentation/Combine/Publishers/Zip/Failure)

The kind of errors this publisher might publish.

### Inspecting publisher properties

[`a`](/documentation/Combine/Publishers/Zip/a)

A publisher to zip.

[`b`](/documentation/Combine/Publishers/Zip/b)

Another publisher to zip.

### Comparing publishers

[`==(_:_:)`](/documentation/Combine/Publishers/Zip/==(_:_:))

Returns a Boolean value that indicates whether two publishers are equivalent.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)