<!--
{
  "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/Share",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO5ShareC"
  },
  "title" : "Publishers.Share"
}
-->

# Publishers.Share

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

```
final class Share<Upstream> where Upstream : Publisher
```

## Overview

This publisher type supports multiple subscribers, all of whom receive unchanged elements and completion states from the upstream publisher.

> Tip: ``doc://com.apple.Combine/documentation/Combine/Publishers/Share`` is effectively a combination of the ``doc://com.apple.Combine/documentation/Combine/Publishers/Multicast`` and ``doc://com.apple.Combine/documentation/Combine/PassthroughSubject`` publishers, with an implicit ``doc://com.apple.Combine/documentation/Combine/ConnectablePublisher/autoconnect()``.

Be aware that [`Publishers.Share`](/documentation/Combine/Publishers/Share) is a class rather than a structure like most other publishers. Use this type when you need a publisher instance that uses reference semantics.

## Topics

### Creating a share publisher

[`init(upstream:)`](/documentation/Combine/Publishers/Share/init(upstream:))

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

### Declaring supporting types

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

The kind of values published by this publisher.

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

The kind of errors this publisher might publish.

### Inspecting publisher properties

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

The publisher from which this publisher receives elements.

### Comparing publishers

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

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)