No overview available.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Combine
No overview available.
SDKs
Framework
func all Satisfy((Upstream .Output) -> Bool) -> Publishers .All Satisfy<Publishers .Timeout<Upstream, Context>>
Publishes a single Boolean value that indicates whether all received elements pass a given predicate.
func append(Upstream .Output...) -> Publishers .Concatenate<Publishers .Timeout<Upstream, Context>, Publishers .Sequence<[Upstream .Output], Upstream .Failure>>
Append the output of a publisher with the specified sequence.
func assert No Failure(String, file: Static String, line: UInt) -> Publishers .Assert No Failure<Publishers .Timeout<Upstream, Context>>
Raises a fatal error when its upstream publisher fails, and otherwise republishes all received input.
func assign<Root>(to: Reference Writable Key Path<Root, Upstream .Output>, on: Root) -> Any Cancellable
Assigns a publisher’s output to a property of an object.
func breakpoint(receive Subscription: ((Subscription) -> Bool)?, receive Output: ((Upstream .Output) -> Bool)?, receive Completion: ((Subscribers .Completion<Upstream .Failure>) -> Bool)?) -> Publishers .Breakpoint<Publishers .Timeout<Upstream, Context>>
Raises a debugger signal when a provided closure needs to stop the process in the debugger.
func breakpoint On Error() -> Publishers .Breakpoint<Publishers .Timeout<Upstream, Context>>
Raises a debugger signal upon receiving a failure.
func buffer(size: Int, prefetch: Publishers .Prefetch Strategy, when Full: Publishers .Buffering Strategy<Upstream .Failure>) -> Publishers .Buffer<Publishers .Timeout<Upstream, Context>>
Buffers elements received from an upstream publisher.
func `catch`<P>((Upstream .Failure) -> P) -> Publishers .Catch<Publishers .Timeout<Upstream, Context>, P>
Handles errors from an upstream publisher by replacing it with another publisher.
func collect() -> Publishers .Collect<Publishers .Timeout<Upstream, Context>>
Collects all received elements, and emits a single array of the collection when the upstream publisher finishes.
func collect(Int) -> Publishers .Collect By Count<Publishers .Timeout<Upstream, Context>>
Collects up to the specified number of elements, and then emits a single array of the collection.
func collect<S>(Publishers .Time Grouping Strategy<S>, options: S .Scheduler Options?) -> Publishers .Collect By Time<Publishers .Timeout<Upstream, Context>, S>
Collects elements by a given strategy, and emits a single array of the collection.
func combine Latest<P>(P) -> Publishers .Combine Latest<Publishers .Timeout<Upstream, Context>, P>
Subscribes to an additional publisher and publishes a tuple upon receiving output from either publisher.
func combine Latest<P, Q>(P, Q) -> Publishers .Combine Latest3<Publishers .Timeout<Upstream, Context>, P, Q>
Subscribes to two additional publishers and publishes a tuple upon receiving output from any of the publishers.
func combine Latest<P, T>(P, (Upstream .Output, P .Output) -> T) -> Publishers .Map<Publishers .Combine Latest<Publishers .Timeout<Upstream, Context>, P>, T>
Subscribes to an additional publisher and invokes a closure upon receiving output from either publisher.
func combine Latest<P, Q, R>(P, Q, R) -> Publishers .Combine Latest4<Publishers .Timeout<Upstream, Context>, P, Q, R>
Subscribes to three additional publishers and publishes a tuple upon receiving output from any of the publishers.
func combine Latest<P, Q, T>(P, Q, (Upstream .Output, P .Output, Q .Output) -> T) -> Publishers .Map<Publishers .Combine Latest3<Publishers .Timeout<Upstream, Context>, P, Q>, T>
Subscribes to two additional publishers and invokes a closure upon receiving output from any of the publishers.
func combine Latest<P, Q, R, T>(P, Q, R, (Upstream .Output, P .Output, Q .Output, R .Output) -> T) -> Publishers .Map<Publishers .Combine Latest4<Publishers .Timeout<Upstream, Context>, P, Q, R>, T>
Subscribes to three additional publishers and invokes a closure upon receiving output from any of the publishers.
func compact Map<T>((Upstream .Output) -> T?) -> Publishers .Compact Map<Publishers .Timeout<Upstream, Context>, T>
Calls a closure with each received element and publishes any returned optional that has a value.
func contains(Upstream .Output) -> Publishers .Contains<Publishers .Timeout<Upstream, Context>>
Publishes a Boolean value upon receiving an element equal to the argument.
func contains(where: (Upstream .Output) -> Bool) -> Publishers .Contains Where<Publishers .Timeout<Upstream, Context>>
Publishes a Boolean value upon receiving an element that satisfies the predicate closure.
func count() -> Publishers .Count<Publishers .Timeout<Upstream, Context>>
Publishes the number of elements received from the upstream publisher.
func debounce<S>(for: S .Scheduler Time Type .Stride, scheduler: S, options: S .Scheduler Options?) -> Publishers .Debounce<Publishers .Timeout<Upstream, Context>, S>
Publishes elements only after a specified time interval elapses between events.
func decode<Item, Coder>(type: Item .Type, decoder: Coder) -> Publishers .Decode<Publishers .Timeout<Upstream, Context>, Item, Coder>
Decodes the output from upstream using a specified decoder.
func delay<S>(for: S .Scheduler Time Type .Stride, tolerance: S .Scheduler Time Type .Stride?, scheduler: S, options: S .Scheduler Options?) -> Publishers .Delay<Publishers .Timeout<Upstream, Context>, S>
Delays delivery of all output to the downstream receiver by a specified amount of time on a particular scheduler.
func drop<P>(until Output From: P) -> Publishers .Drop Until Output<Publishers .Timeout<Upstream, Context>, P>
Ignores elements from the upstream publisher until it receives an element from a second publisher.
func drop(while: (Upstream .Output) -> Bool) -> Publishers .Drop While<Publishers .Timeout<Upstream, Context>>
Omits elements from the upstream publisher until a given closure returns false, before republishing all remaining elements.
func drop First(Int) -> Publishers .Drop<Publishers .Timeout<Upstream, Context>>
Omits the specified number of elements before republishing subsequent elements.
func encode<Coder>(encoder: Coder) -> Publishers .Encode<Publishers .Timeout<Upstream, Context>, Coder>
Encodes the output from upstream using a specified encoder.
func erase To Any Publisher() -> Any Publisher<Upstream .Output, Upstream .Failure>
Wraps this publisher with a type eraser.
func filter((Upstream .Output) -> Bool) -> Publishers .Filter<Publishers .Timeout<Upstream, Context>>
Republishes all elements that match a provided closure.
func first() -> Publishers .First<Publishers .Timeout<Upstream, Context>>
Publishes the first element of a stream, then finishes.
func first(where: (Upstream .Output) -> Bool) -> Publishers .First Where<Publishers .Timeout<Upstream, Context>>
Publishes the first element of a stream to satisfy a predicate closure, then finishes.
func flat Map<T, P>(max Publishers: Subscribers .Demand, (Upstream .Output) -> P) -> Publishers .Flat Map<P, Publishers .Timeout<Upstream, Context>>
Transforms all elements from an upstream publisher into a new or existing publisher.
func handle Events(receive Subscription: ((Subscription) -> Void)?, receive Output: ((Upstream .Output) -> Void)?, receive Completion: ((Subscribers .Completion<Upstream .Failure>) -> Void)?, receive Cancel: (() -> Void)?, receive Request: ((Subscribers .Demand) -> Void)?) -> Publishers .Handle Events<Publishers .Timeout<Upstream, Context>>
Performs the specified closures when publisher events occur.
func ignore Output() -> Publishers .Ignore Output<Publishers .Timeout<Upstream, Context>>
Ingores all upstream elements, but passes along a completion state (finished or failed).
func last() -> Publishers .Last<Publishers .Timeout<Upstream, Context>>
Publishes only the last element of a stream, after the stream finishes.
func last(where: (Upstream .Output) -> Bool) -> Publishers .Last Where<Publishers .Timeout<Upstream, Context>>
Publishes only the last element of a stream that satisfies a predicate closure, after the stream finishes.
func make Connectable() -> Publishers .Make Connectable<Publishers .Timeout<Upstream, Context>>
Creates a connectable wrapper around the publisher.
func map<T>((Upstream .Output) -> T) -> Publishers .Map<Publishers .Timeout<Upstream, Context>, T>
Transforms all elements from the upstream publisher with a provided closure.
func map<T>(Key Path<Upstream .Output, T>) -> Publishers .Map Key Path<Publishers .Timeout<Upstream, Context>, T>
Publishes the value of a key path.
func map<T0, T1>(Key Path<Upstream .Output, T0>, Key Path<Upstream .Output, T1>) -> Publishers .Map Key Path2<Publishers .Timeout<Upstream, Context>, T0, T1>
Publishes the values of two key paths as a tuple.
func map<T0, T1, T2>(Key Path<Upstream .Output, T0>, Key Path<Upstream .Output, T1>, Key Path<Upstream .Output, T2>) -> Publishers .Map Key Path3<Publishers .Timeout<Upstream, Context>, T0, T1, T2>
Publishes the values of three key paths as a tuple.
func map Error<E>((Upstream .Failure) -> E) -> Publishers .Map Error<Publishers .Timeout<Upstream, Context>, E>
Converts any failure from the upstream publisher into a new error.
func max() -> Publishers .Comparison<Publishers .Timeout<Upstream, Context>>
Publishes the maximum value received from the upstream publisher, after it finishes.
func max(by: (Upstream .Output, Upstream .Output) -> Bool) -> Publishers .Comparison<Publishers .Timeout<Upstream, Context>>
Publishes the maximum value received from the upstream publisher, using the provided ordering closure.
func measure Interval<S>(using: S, options: S .Scheduler Options?) -> Publishers .Measure Interval<Publishers .Timeout<Upstream, Context>, S>
Measures and emits the time interval between events received from an upstream publisher.
func merge(with: Publishers .Timeout<Upstream, Context>) -> Publishers .Merge Many<Publishers .Timeout<Upstream, Context>>
Combines elements from this publisher with those from another publisher of the same type, delivering an interleaved sequence of elements.
func merge<B, C>(with: B, C) -> Publishers .Merge3<Publishers .Timeout<Upstream, Context>, B, C>
Combines elements from this publisher with those from two other publishers, delivering an interleaved sequence of elements.
func merge<B, C, D>(with: B, C, D) -> Publishers .Merge4<Publishers .Timeout<Upstream, Context>, B, C, D>
Combines elements from this publisher with those from three other publishers, delivering an interleaved sequence of elements.
func merge<B, C, D, E>(with: B, C, D, E) -> Publishers .Merge5<Publishers .Timeout<Upstream, Context>, B, C, D, E>
Combines elements from this publisher with those from four other publishers, delivering an interleaved sequence of elements.
func merge<B, C, D, E, F>(with: B, C, D, E, F) -> Publishers .Merge6<Publishers .Timeout<Upstream, Context>, B, C, D, E, F>
Combines elements from this publisher with those from five other publishers, delivering an interleaved sequence of elements.
func merge<B, C, D, E, F, G>(with: B, C, D, E, F, G) -> Publishers .Merge7<Publishers .Timeout<Upstream, Context>, B, C, D, E, F, G>
Combines elements from this publisher with those from six other publishers, delivering an interleaved sequence of elements.
func merge<B, C, D, E, F, G, H>(with: B, C, D, E, F, G, H) -> Publishers .Merge8<Publishers .Timeout<Upstream, Context>, B, C, D, E, F, G, H>
Combines elements from this publisher with those from seven other publishers, delivering an interleaved sequence of elements.
func min() -> Publishers .Comparison<Publishers .Timeout<Upstream, Context>>
Publishes the minimum value received from the upstream publisher, after it finishes.
func min(by: (Upstream .Output, Upstream .Output) -> Bool) -> Publishers .Comparison<Publishers .Timeout<Upstream, Context>>
Publishes the minimum value received from the upstream publisher, after it finishes.
func multicast<S>(() -> S) -> Publishers .Multicast<Publishers .Timeout<Upstream, Context>, S>
Applies a closure to create a subject that delivers elements to subscribers.
func multicast<S>(subject: S) -> Publishers .Multicast<Publishers .Timeout<Upstream, Context>, S>
Provides a subject to deliver elements to multiple subscribers.
func output(at: Int) -> Publishers .Output<Publishers .Timeout<Upstream, Context>>
Publishes a specific element, indicated by its index in the sequence of published elements.
func output<R>(in: R) -> Publishers .Output<Publishers .Timeout<Upstream, Context>>
Publishes elements specified by their range in the sequence of published elements.
func prefix(Int) -> Publishers .Output<Publishers .Timeout<Upstream, Context>>
Republishes elements up to the specified maximum count.
func prefix<P>(until Output From: P) -> Publishers .Prefix Until Output<Publishers .Timeout<Upstream, Context>, P>
Republishes elements until another publisher emits an element.
func prefix(while: (Upstream .Output) -> Bool) -> Publishers .Prefix While<Publishers .Timeout<Upstream, Context>>
Republishes elements while a predicate closure indicates publishing should continue.
func prepend(Upstream .Output...) -> Publishers .Concatenate<Publishers .Sequence<[Upstream .Output], Upstream .Failure>, Publishers .Timeout<Upstream, Context>>
Prefixes the output of a publisher with the specified sequence.
func print(String, to: Text Output Stream?) -> Publishers .Print<Publishers .Timeout<Upstream, Context>>
Prints log messages for all publishing events.
func receive<S>(on: S, options: S .Scheduler Options?) -> Publishers .Receive On<Publishers .Timeout<Upstream, Context>, S>
Specifies the scheduler on which to receive elements from the publisher.
func reduce<T>(T, (T, Upstream .Output) -> T) -> Publishers .Reduce<Publishers .Timeout<Upstream, Context>, T>
Applies a closure that accumulates each element of a stream and publishes a final result upon completion.
func remove Duplicates() -> Publishers .Remove Duplicates<Publishers .Timeout<Upstream, Context>>
Publishes only elements that don’t match the previous element.
func remove Duplicates(by: (Upstream .Output, Upstream .Output) -> Bool) -> Publishers .Remove Duplicates<Publishers .Timeout<Upstream, Context>>
Publishes only elements that don’t match the previous element, as evaluated by a provided closure.
func replace Empty(with: Upstream .Output) -> Publishers .Replace Empty<Publishers .Timeout<Upstream, Context>>
Replaces an empty stream with the provided element.
func replace Error(with: Upstream .Output) -> Publishers .Replace Error<Publishers .Timeout<Upstream, Context>>
Replaces any errors in the stream with the provided element.
func replace Nil<T>(with: T) -> Publishers .Map<Publishers .Timeout<Upstream, Context>, T>
Replaces nil elements in the stream with the provided element.
func retry(Int) -> Publishers .Retry<Publishers .Timeout<Upstream, Context>>
Attempts to recreate a failed subscription with the upstream publisher using a specified number of attempts to establish the connection.
func scan<T>(T, (T, Upstream .Output) -> T) -> Publishers .Scan<Publishers .Timeout<Upstream, Context>, T>
Transforms elements from the upstream publisher by providing the current element to a closure along with the last value returned by the closure.
func set Failure Type<E>(to: E .Type) -> Publishers .Set Failure Type<Publishers .Timeout<Upstream, Context>, E>
Changes the failure type declared by the upstream publisher.
func share() -> Publishers .Share<Publishers .Timeout<Upstream, Context>>
Returns a publisher as a class instance.
func sink(receive Completion: ((Subscribers .Completion<Upstream .Failure>) -> Void), receive Value: ((Upstream .Output) -> Void)) -> Any Cancellable
Attaches a subscriber with closure-based behavior.
func sink(receive Value: ((Upstream .Output) -> Void)) -> Any Cancellable
Attaches a subscriber with closure-based behavior to a publisher that never fails.
func subscribe<S>(S) -> Any Cancellable
Attaches the specified subject to this publisher.
func subscribe<S>(S)
Attaches the specified subscriber to this publisher.
func subscribe<S>(on: S, options: S .Scheduler Options?) -> Publishers .Subscribe On<Publishers .Timeout<Upstream, Context>, S>
Specifies the scheduler on which to perform subscribe, cancel, and request operations.
func switch To Latest() -> Publishers .Switch To Latest<Upstream .Output, Publishers .Timeout<Upstream, Context>>
Flattens the stream of events from multiple upstream publishers to appear as if they were coming from a single stream of events.
func throttle<S>(for: S .Scheduler Time Type .Stride, scheduler: S, latest: Bool) -> Publishers .Throttle<Publishers .Timeout<Upstream, Context>, S>
Publishes either the most-recent or first element published by the upstream publisher in the specified time interval.
func timeout<S>(S .Scheduler Time Type .Stride, scheduler: S, options: S .Scheduler Options?, custom Error: (() -> Upstream .Failure)?) -> Publishers .Timeout<Publishers .Timeout<Upstream, Context>, S>
Terminates publishing if the upstream publisher exceeds the specified time interval without producing an element.
func try All Satisfy((Upstream .Output) -> Bool) -> Publishers .Try All Satisfy<Publishers .Timeout<Upstream, Context>>
Publishes a single Boolean value that indicates whether all received elements pass a given error-throwing predicate.
func try Catch<P>((Upstream .Failure) -> P) -> Publishers .Try Catch<Publishers .Timeout<Upstream, Context>, P>
Handles errors from an upstream publisher by replacing it with another publisher or an error.
func try Compact Map<T>((Upstream .Output) -> T?) -> Publishers .Try Compact Map<Publishers .Timeout<Upstream, Context>, T>
Calls an error-throwing closure with each received element and publishes any returned optional that has a value.
func try Contains(where: (Upstream .Output) -> Bool) -> Publishers .Try Contains Where<Publishers .Timeout<Upstream, Context>>
Publishes a Boolean value upon receiving an element that satisfies the throwing predicate closure.
func try Drop(while: (Upstream .Output) -> Bool) -> Publishers .Try Drop While<Publishers .Timeout<Upstream, Context>>
Omits elements from the upstream publisher until an error-throwing closure returns false, before republishing all remaining elements.
func try Filter((Upstream .Output) -> Bool) -> Publishers .Try Filter<Publishers .Timeout<Upstream, Context>>
Republishes all elements that match a provided error-throwing closure.
func try First(where: (Upstream .Output) -> Bool) -> Publishers .Try First Where<Publishers .Timeout<Upstream, Context>>
Publishes the first element of a stream to satisfy a throwing predicate closure, then finishes.
func try Last(where: (Upstream .Output) -> Bool) -> Publishers .Try Last Where<Publishers .Timeout<Upstream, Context>>
Publishes only the last element of a stream that satisfies an error-throwing predicate closure, after the stream finishes.
func try Map<T>((Upstream .Output) -> T) -> Publishers .Try Map<Publishers .Timeout<Upstream, Context>, T>
Transforms all elements from the upstream publisher with a provided error-throwing closure.
func try Max(by: (Upstream .Output, Upstream .Output) -> Bool) -> Publishers .Try Comparison<Publishers .Timeout<Upstream, Context>>
Publishes the maximum value received from the upstream publisher, using the provided error-throwing closure to order the items.
func try Min(by: (Upstream .Output, Upstream .Output) -> Bool) -> Publishers .Try Comparison<Publishers .Timeout<Upstream, Context>>
Publishes the minimum value received from the upstream publisher, using the provided error-throwing closure to order the items.
func try Prefix(while: (Upstream .Output) -> Bool) -> Publishers .Try Prefix While<Publishers .Timeout<Upstream, Context>>
Republishes elements while a error-throwing predicate closure indicates publishing should continue.
func try Reduce<T>(T, (T, Upstream .Output) -> T) -> Publishers .Try Reduce<Publishers .Timeout<Upstream, Context>, T>
Applies an error-throwing closure that accumulates each element of a stream and publishes a final result upon completion.
func try Remove Duplicates(by: (Upstream .Output, Upstream .Output) -> Bool) -> Publishers .Try Remove Duplicates<Publishers .Timeout<Upstream, Context>>
Publishes only elements that don’t match the previous element, as evaluated by a provided error-throwing closure.
func try Scan<T>(T, (T, Upstream .Output) -> T) -> Publishers .Try Scan<Publishers .Timeout<Upstream, Context>, T>
Transforms elements from the upstream publisher by providing the current element to an error-throwing closure along with the last value returned by the closure.
func zip<P>(P) -> Publishers .Zip<Publishers .Timeout<Upstream, Context>, P>
Combines elements from another publisher and deliver pairs of elements as tuples.
func zip<P, Q>(P, Q) -> Publishers .Zip3<Publishers .Timeout<Upstream, Context>, P, Q>
Combines elements from two other publishers and delivers groups of elements as tuples.
func zip<P, T>(P, (Upstream .Output, P .Output) -> T) -> Publishers .Map<Publishers .Zip<Publishers .Timeout<Upstream, Context>, P>, T>
Combines elements from another publisher and delivers a transformed output.
func zip<P, Q, R>(P, Q, R) -> Publishers .Zip4<Publishers .Timeout<Upstream, Context>, P, Q, R>
Combines elements from three other publishers and delivers groups of elements as tuples.
func zip<P, Q, T>(P, Q, (Upstream .Output, P .Output, Q .Output) -> T) -> Publishers .Map<Publishers .Zip3<Publishers .Timeout<Upstream, Context>, P, Q>, T>
Combines elements from two other publishers and delivers a transformed output.
func zip<P, Q, R, T>(P, Q, R, (Upstream .Output, P .Output, Q .Output, R .Output) -> T) -> Publishers .Map<Publishers .Zip4<Publishers .Timeout<Upstream, Context>, P, Q, R>, T>
Combines elements from three other publishers and delivers a transformed output.
struct Publishers .Debounce
A publisher that publishes elements only after a specified time interval elapses between events.
struct Publishers .Delay
A publisher that delays delivery of elements and completion to the downstream receiver.
struct Publishers .Measure Interval
A publisher that measures and emits the time interval between events received from an upstream publisher.
struct Publishers .Throttle
A publisher that publishes either the most-recent or first element published by the upstream publisher in a specified time interval.