Instance Method


Returns a publisher as a class instance.


func share() -> Publishers.Share<Publishers.Share<Upstream>>

Return Value

A class instance that republishes its upstream publisher.


The downstream subscriber receieves elements and completion states unchanged from the upstream publisher. Use this operator when you want to use reference semantics, such as storing a publisher instance in a property.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software