<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO"
  },
  "title" : "Publishers"
}
-->

# Publishers

A namespace for types that serve as publishers.

```
enum Publishers
```

## Overview

The various operators defined as extensions on [`Publisher`](/documentation/Combine/Publisher) implement their functionality as classes or structures that extend this enumeration. For example, the `contains(_:)` operator returns a `Publishers.Contains` instance.

## Topics

### Convenience publishers

[`Publishers.Sequence`](/documentation/Combine/Publishers/Sequence)

A publisher that publishes a given sequence of elements.

[`Publishers.Catch`](/documentation/Combine/Publishers/Catch)

A publisher that handles errors from an upstream publisher by replacing the failed publisher with another publisher.

### Working with subscribers

[`Publishers.ReceiveOn`](/documentation/Combine/Publishers/ReceiveOn)

A publisher that delivers elements to its downstream subscriber on a specific scheduler.

[`Publishers.SubscribeOn`](/documentation/Combine/Publishers/SubscribeOn)

A publisher that receives elements from an upstream publisher on a specific scheduler.

### Mapping elements

[`Publishers.Map`](/documentation/Combine/Publishers/Map)

A publisher that transforms all elements from the upstream publisher with a provided closure.

[`Publishers.TryMap`](/documentation/Combine/Publishers/TryMap)

A publisher that transforms all elements from the upstream publisher with a provided error-throwing closure.

[`Publishers.MapError`](/documentation/Combine/Publishers/MapError)

A publisher that converts any failure from the upstream publisher into a new error.

[`Publishers.Scan`](/documentation/Combine/Publishers/Scan)

A publisher that transforms elements from the upstream publisher by providing the current element to a closure along with the last value returned by the closure.

[`Publishers.TryScan`](/documentation/Combine/Publishers/TryScan)

A publisher that transforms elements from the upstream publisher by providing the current element to a failable closure along with the last value returned by the closure.

[`Publishers.SetFailureType`](/documentation/Combine/Publishers/SetFailureType)

A publisher that appears to send a specified failure type.

### Filtering elements

[`Publishers.Filter`](/documentation/Combine/Publishers/Filter)

A publisher that republishes all elements that match a provided closure.

[`Publishers.TryFilter`](/documentation/Combine/Publishers/TryFilter)

A publisher that republishes all elements that match a provided error-throwing closure.

[`Publishers.CompactMap`](/documentation/Combine/Publishers/CompactMap)

A publisher that republishes all non-nil results of calling a closure with each received element.

[`Publishers.TryCompactMap`](/documentation/Combine/Publishers/TryCompactMap)

A publisher that republishes all non-nil results of calling an error-throwing closure with each received element.

[`Publishers.RemoveDuplicates`](/documentation/Combine/Publishers/RemoveDuplicates)

A publisher that publishes only elements that don’t match the previous element.

[`Publishers.TryRemoveDuplicates`](/documentation/Combine/Publishers/TryRemoveDuplicates)

A publisher that publishes only elements that don’t match the previous element, as evaluated by a provided error-throwing closure.

[`Publishers.ReplaceEmpty`](/documentation/Combine/Publishers/ReplaceEmpty)

A publisher that replaces an empty stream with a provided element.

[`Publishers.ReplaceError`](/documentation/Combine/Publishers/ReplaceError)

A publisher that replaces any errors in the stream with a provided element.

### Reducing elements

[`Publishers.Collect`](/documentation/Combine/Publishers/Collect)

A publisher that buffers items.

[`Publishers.CollectByCount`](/documentation/Combine/Publishers/CollectByCount)

A publisher that buffers a maximum number of items.

[`Publishers.CollectByTime`](/documentation/Combine/Publishers/CollectByTime)

A publisher that buffers and periodically publishes its items.

[`Publishers.TimeGroupingStrategy`](/documentation/Combine/Publishers/TimeGroupingStrategy)

A strategy for collecting received elements.

[`Publishers.IgnoreOutput`](/documentation/Combine/Publishers/IgnoreOutput)

A publisher that ignores all upstream elements, but passes along the upstream publisher’s completion state (finished or failed).

[`Publishers.Reduce`](/documentation/Combine/Publishers/Reduce)

A publisher that applies a closure to all received elements and produces an accumulated value when the upstream publisher finishes.

[`Publishers.TryReduce`](/documentation/Combine/Publishers/TryReduce)

A publisher that applies an error-throwing closure to all received elements and produces an accumulated value when the upstream publisher finishes.

### Applying mathematical operations on elements

[`Publishers.Count`](/documentation/Combine/Publishers/Count)

A publisher that publishes the number of elements received from the upstream publisher.

[`Publishers.Comparison`](/documentation/Combine/Publishers/Comparison)

A publisher that republishes items from another publisher only if each new item is in increasing order from the previously-published item.

[`Publishers.TryComparison`](/documentation/Combine/Publishers/TryComparison)

A publisher that republishes items from another publisher only if each new item is in increasing order from the previously-published item, and fails if the ordering logic throws an error.

### Applying matching criteria to elements

[`Publishers.Contains`](/documentation/Combine/Publishers/Contains)

A publisher that emits a Boolean value when it receives a specific element from its upstream publisher.

[`Publishers.ContainsWhere`](/documentation/Combine/Publishers/ContainsWhere)

A publisher that emits a Boolean value upon receiving an element that satisfies the predicate closure.

[`Publishers.TryContainsWhere`](/documentation/Combine/Publishers/TryContainsWhere)

A publisher that emits a Boolean value upon receiving an element that satisfies the throwing predicate closure.

[`Publishers.AllSatisfy`](/documentation/Combine/Publishers/AllSatisfy)

A publisher that publishes a single Boolean value that indicates whether all received elements pass a given predicate.

[`Publishers.TryAllSatisfy`](/documentation/Combine/Publishers/TryAllSatisfy)

A publisher that publishes a single Boolean value that indicates whether all received elements pass a given error-throwing predicate.

### Applying sequence operations to elements

[`Publishers.DropUntilOutput`](/documentation/Combine/Publishers/DropUntilOutput)

A publisher that ignores elements from the upstream publisher until it receives an element from second publisher.

[`Publishers.Drop`](/documentation/Combine/Publishers/Drop)

A publisher that omits a specified number of elements before republishing later elements.

[`Publishers.DropWhile`](/documentation/Combine/Publishers/DropWhile)

A publisher that omits elements from an upstream publisher until a given closure returns false.

[`Publishers.TryDropWhile`](/documentation/Combine/Publishers/TryDropWhile)

A publisher that omits elements from an upstream publisher until a given error-throwing closure returns false.

[`Publishers.Concatenate`](/documentation/Combine/Publishers/Concatenate)

A publisher that emits all of one publisher’s elements before those from another publisher.

[`Publishers.PrefixWhile`](/documentation/Combine/Publishers/PrefixWhile)

A publisher that republishes elements while a predicate closure indicates publishing should continue.

[`Publishers.TryPrefixWhile`](/documentation/Combine/Publishers/TryPrefixWhile)

A publisher that republishes elements while an error-throwing predicate closure indicates publishing should continue.

[`Publishers.PrefixUntilOutput`](/documentation/Combine/Publishers/PrefixUntilOutput)

A publisher that republishes elements until another publisher emits an element.

### Selecting specific elements

[`Publishers.First`](/documentation/Combine/Publishers/First)

A publisher that publishes the first element of a stream, then finishes.

[`Publishers.FirstWhere`](/documentation/Combine/Publishers/FirstWhere)

A publisher that only publishes the first element of a stream to satisfy a predicate closure.

[`Publishers.TryFirstWhere`](/documentation/Combine/Publishers/TryFirstWhere)

A publisher that only publishes the first element of a stream to satisfy a throwing predicate closure.

[`Publishers.Last`](/documentation/Combine/Publishers/Last)

A publisher that waits until after the stream finishes, and then publishes the last element of the stream.

[`Publishers.LastWhere`](/documentation/Combine/Publishers/LastWhere)

A publisher that waits until after the stream finishes and then publishes the last element of the stream that satisfies a predicate closure.

[`Publishers.TryLastWhere`](/documentation/Combine/Publishers/TryLastWhere)

A publisher that waits until after the stream finishes and then publishes the last element of the stream that satisfies an error-throwing predicate closure.

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

A publisher that publishes elements specified by a range in the sequence of published elements.

### Combining elements from multiple publishers

[`Publishers.CombineLatest`](/documentation/Combine/Publishers/CombineLatest)

A publisher that receives and combines the latest elements from two publishers.

[`Publishers.CombineLatest3`](/documentation/Combine/Publishers/CombineLatest3)

A publisher that receives and combines the latest elements from three publishers.

[`Publishers.CombineLatest4`](/documentation/Combine/Publishers/CombineLatest4)

A publisher that receives and combines the latest elements from four publishers.

[`Publishers.Merge`](/documentation/Combine/Publishers/Merge)

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

[`Publishers.Merge3`](/documentation/Combine/Publishers/Merge3)

A publisher created by applying the merge function to three upstream publishers.

[`Publishers.Merge4`](/documentation/Combine/Publishers/Merge4)

A publisher created by applying the merge function to four upstream publishers.

[`Publishers.Merge5`](/documentation/Combine/Publishers/Merge5)

A publisher created by applying the merge function to five upstream publishers.

[`Publishers.Merge6`](/documentation/Combine/Publishers/Merge6)

A publisher created by applying the merge function to six upstream publishers.

[`Publishers.Merge7`](/documentation/Combine/Publishers/Merge7)

A publisher created by applying the merge function to seven upstream publishers.

[`Publishers.Merge8`](/documentation/Combine/Publishers/Merge8)

A publisher created by applying the merge function to eight upstream publishers.

[`Publishers.MergeMany`](/documentation/Combine/Publishers/MergeMany)

A publisher created by applying the merge function to an arbitrary number of upstream publishers.

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

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

[`Publishers.Zip3`](/documentation/Combine/Publishers/Zip3)

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

[`Publishers.Zip4`](/documentation/Combine/Publishers/Zip4)

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

### Republishing elements by subscribing to new publishers

[`Publishers.FlatMap`](/documentation/Combine/Publishers/FlatMap)

A publisher that transforms elements from an upstream publisher into a new publisher.

[`Publishers.SwitchToLatest`](/documentation/Combine/Publishers/SwitchToLatest)

A publisher that flattens nested publishers.

### Handling errors

[`Publishers.AssertNoFailure`](/documentation/Combine/Publishers/AssertNoFailure)

A publisher that raises a fatal error upon receiving any failure, and otherwise republishes all received input.

[`Publishers.Catch`](/documentation/Combine/Publishers/Catch)

A publisher that handles errors from an upstream publisher by replacing the failed publisher with another publisher.

[`Publishers.TryCatch`](/documentation/Combine/Publishers/TryCatch)

A publisher that handles errors from an upstream publisher by replacing the failed publisher with another publisher or producing a new error.

[`Publishers.Retry`](/documentation/Combine/Publishers/Retry)

A publisher that attempts to recreate its subscription to a failed upstream publisher.

### Controlling timing

[`Publishers.MeasureInterval`](/documentation/Combine/Publishers/MeasureInterval)

A publisher that measures and emits the time interval between events received from an upstream publisher.

[`Publishers.Debounce`](/documentation/Combine/Publishers/Debounce)

A publisher that publishes elements only after a specified time interval elapses between events.

[`Publishers.Delay`](/documentation/Combine/Publishers/Delay)

A publisher that delays delivery of elements and completion to the downstream receiver.

[`Publishers.Throttle`](/documentation/Combine/Publishers/Throttle)

A publisher that publishes either the most-recent or first element published by the upstream publisher in a specified time interval.

[`Publishers.Timeout`](/documentation/Combine/Publishers/Timeout)

A publisher that terminates publishing if the upstream publisher exceeds a specified time interval without producing an element.

### Encoding and decoding

[`Publishers.Decode`](/documentation/Combine/Publishers/Decode)

A publisher that decodes elements received from an upstream publisher, using a given decoder.

[`Publishers.Encode`](/documentation/Combine/Publishers/Encode)

A publisher that encodes elements received from an upstream publisher, using a given encoder.

### Identifying properties with key paths

[`Publishers.MapKeyPath`](/documentation/Combine/Publishers/MapKeyPath)

A publisher that publishes the value of a key path.

[`Publishers.MapKeyPath2`](/documentation/Combine/Publishers/MapKeyPath2)

A publisher that publishes the values of two key paths as a tuple.

[`Publishers.MapKeyPath3`](/documentation/Combine/Publishers/MapKeyPath3)

A publisher that publishes the values of three key paths as a tuple.

### Working with multiple subscribers

[`Publishers.Multicast`](/documentation/Combine/Publishers/Multicast)

A publisher that uses a subject to deliver elements to multiple subscribers.

[`Publishers.Share`](/documentation/Combine/Publishers/Share)

A publisher that shares the output of an upstream publisher with multiple subscribers.

### Buffering elements

[`Publishers.Buffer`](/documentation/Combine/Publishers/Buffer)

A publisher that buffers elements from an upstream publisher.

[`Publishers.BufferingStrategy`](/documentation/Combine/Publishers/BufferingStrategy)

A strategy that handles exhaustion of a buffer’s capacity.

[`Publishers.PrefetchStrategy`](/documentation/Combine/Publishers/PrefetchStrategy)

A strategy for filling a buffer.

### Using explicit publisher connections

[`Publishers.Autoconnect`](/documentation/Combine/Publishers/Autoconnect)

A publisher that automatically connects to an upstream connectable publisher.

[`Publishers.MakeConnectable`](/documentation/Combine/Publishers/MakeConnectable)

A publisher that provides explicit connectability to another publisher.

### Debugging

[`Publishers.Breakpoint`](/documentation/Combine/Publishers/Breakpoint)

A publisher that raises a debugger signal when a provided closure needs to stop the process in the debugger.

[`Publishers.HandleEvents`](/documentation/Combine/Publishers/HandleEvents)

A publisher that performs the specified closures when publisher events occur.

[`Publishers.Print`](/documentation/Combine/Publishers/Print)

A publisher that prints log messages for all publishing events, optionally prefixed with a given string.



---

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)