<!--
{
  "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

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

A publisher that publishes a given sequence of elements.

[`struct 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

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

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

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

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

### Mapping elements

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

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

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

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

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

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

[`struct 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.

[`struct 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.

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

A publisher that appears to send a specified failure type.

### Filtering elements

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

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

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

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

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

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

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

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

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

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

[`struct 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.

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

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

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

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

### Reducing elements

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

A publisher that buffers items.

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

A publisher that buffers a maximum number of items.

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

A publisher that buffers and periodically publishes its items.

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

A strategy for collecting received elements.

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

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

[`struct 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.

[`struct 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

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

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

[`struct 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.

[`struct 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

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

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

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

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

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

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

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

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

[`struct 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### Selecting specific elements

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

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

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

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

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

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

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

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

[`struct 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.

[`struct 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.

[`struct 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### Republishing elements by subscribing to new publishers

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

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

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

A publisher that flattens nested publishers.

### Handling errors

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

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

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

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

[`struct 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.

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

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

### Controlling timing

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

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

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

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

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

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

[`struct 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.

[`struct 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

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

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

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

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

### Identifying properties with key paths

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

A publisher that publishes the value of a key path.

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

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

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

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

### Working with multiple subscribers

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

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

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

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

### Buffering elements

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

A publisher that buffers elements from an upstream publisher.

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

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

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

A strategy for filling a buffer.

### Using explicit publisher connections

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

A publisher that automatically connects to an upstream connectable publisher.

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

A publisher that provides explicit connectability to another publisher.

### Debugging

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

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

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

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

[`struct 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)