Instance Method

share()

Returns a publisher as a class instance.

Declaration

func share() -> Publishers.Share<Publishers.Concatenate<Prefix, Suffix>>

Return Value

A class instance that republishes its upstream publisher.

Discussion

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