One Logo Pool Ball
Combine · IOS API REFERENCE

AnyPublisher

struct · iOS 13.0+ · SDK 27.1

@frozen struct AnyPublisher<Output, Failure> where Failure : Error

A publisher that performs type erasure by wrapping another publisher. ``AnyPublisher`` is a concrete implementation of ``Publisher`` that has no significant properties of its own, and passes through elements and completion values from its upstream publisher. Use ``AnyPublisher`` to wrap a publisher whose type has details you don’t want to expose across API boundaries, such as different modules. Wrapping a ``Subject`` with ``AnyPublisher`` also prevents callers from accessing its ``Subject/send(_:)`` method. When you use type erasure this way, you can change the underlying publisher implementation over time without affecting existing clients. You can use Combine’s ``Publisher/eraseToAnyPublisher()`` operator to wrap a publisher with ``AnyPublisher``.

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

AnyPublisher.init(_:)

This declaration needs Swift generic type arguments. (no canonical witness for P)

AnyPublisher.receive(subscriber:)

This declaration needs Swift generic type arguments. (no canonical witness for S)

All Combine types →