<!--
{
  "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/Publisher/combineLatest(_:_:_:)-48buc",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine9PublisherPAAE13combineLatestyAA10PublishersO0A7Latest4Vy_xqd__qd_0_qd_1_Gqd___qd_0_qd_1_tAaBRd__AaBRd_0_AaBRd_1_7FailureQyd__AJRtzAJQyd_0_AKRSAJQyd_1_AMRSr1_lF"
  },
  "title" : "combineLatest(_:_:_:)"
}
-->

# combineLatest(_:_:_:)

Subscribes to three additional publishers and publishes a tuple upon receiving output from any of the publishers.

```
func combineLatest<P, Q, R>(_ publisher1: P, _ publisher2: Q, _ publisher3: R) -> Publishers.CombineLatest4<Self, P, Q, R> where P : Publisher, Q : Publisher, R : Publisher, Self.Failure == P.Failure, P.Failure == Q.Failure, Q.Failure == R.Failure
```

## Parameters

`publisher1`

A second publisher to combine with the first publisher.

`publisher2`

A third publisher to combine with the first publisher.

`publisher3`

A fourth publisher to combine with the first publisher.

## Return Value

A publisher that receives and combines elements from this publisher and three other publishers.

## Discussion

Use [`combineLatest(_:_:_:)`](/documentation/Combine/Publisher/combineLatest(_:_:_:)-48buc) when you want the downstream subscriber to receive a tuple of the most-recent element from multiple publishers when any of them emit a value. To combine elements from multiple publishers, use [`zip(_:_:_:)`](/documentation/Combine/Publisher/zip(_:_:_:)-16rcy) instead. To receive just the most-recent element from multiple publishers rather than tuples, use [`merge(with:_:_:)`](/documentation/Combine/Publisher/merge(with:_:_:)).

> Tip: The combined publisher doesn’t produce elements until each of its upstream publishers publishes at least one element.

The combined publisher passes through any requests to *all* upstream publishers. However, it still obeys the demand-fulfilling rule of only sending the request amount downstream. If the demand isn’t [`unlimited`](/documentation/Combine/Subscribers/Demand/unlimited), it drops values from upstream publishers. It implements this by using a buffer size of 1 for each upstream, and holds the most-recent value in each buffer.

All upstream publishers need to finish for this publisher to finish. If an upstream publisher never publishes a value, this publisher never finishes.

In the example below, [`combineLatest(_:_:_:)`](/documentation/Combine/Publisher/combineLatest(_:_:_:)-48buc) receives input from any of the publishers, combines the latest value from each publisher into a tuple and publishes it:

```
let pub = PassthroughSubject<Int, Never>()
let pub2 = PassthroughSubject<Int, Never>()
let pub3 = PassthroughSubject<Int, Never>()
let pub4 = PassthroughSubject<Int, Never>()

cancellable = pub
    .combineLatest(pub2, pub3, pub4)
    .sink { print("Result: \($0).") }

pub.send(1)
pub.send(2)
pub2.send(2)
pub3.send(9)
pub4.send(1)

pub.send(3)
pub2.send(12)
pub.send(13)
pub3.send(19)
//
// Prints:
//  Result: (2, 2, 9, 1).
//  Result: (3, 2, 9, 1).
//  Result: (3, 12, 9, 1).
//  Result: (13, 12, 9, 1).
//  Result: (13, 12, 19, 1).
```

If any individual publisher of the combined set terminates with a failure, this publisher also fails.

---

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)