PrimitiveSequenceType
public protocol PrimitiveSequenceType
                Observable sequences containing 0 or 1 element
- 
                  
                  
Additional constraints
Declaration
Swift
associatedtype TraitType - 
                  
                  
Sequence element type
Declaration
Swift
associatedtype ElementType - 
                  
                  
Declaration
Swift
var primitiveSequence: PrimitiveSequence<TraitType, ElementType> { get }Return Value
Observable sequence that represents
self. 
- 
                  
andThen(_:)Extension methodConcatenates the second observable sequence to
selfupon successful termination ofself.Seealso
Parameters
secondSecond observable sequence.
Return Value
An observable sequence that contains the elements of
self, followed by those of the second sequence. - 
                  
andThen(_:)Extension methodConcatenates the second observable sequence to
selfupon successful termination ofself.Seealso
Parameters
secondSecond observable sequence.
Return Value
An observable sequence that contains the elements of
self, followed by those of the second sequence. - 
                  
andThen(_:)Extension methodConcatenates the second observable sequence to
selfupon successful termination ofself.Seealso
Declaration
Swift
public func andThen(_ second: Completable) -> CompletableParameters
secondSecond observable sequence.
Return Value
An observable sequence that contains the elements of
self, followed by those of the second sequence. - 
                  
andThen(_:)Extension methodConcatenates the second observable sequence to
selfupon successful termination ofself.Seealso
Declaration
Swift
public func andThen<E>(_ second: Observable<E>) -> Observable<E>Parameters
secondSecond observable sequence.
Return Value
An observable sequence that contains the elements of
self, followed by those of the second sequence. 
- 
                  
CompletableObserverExtension methodUndocumented
Declaration
Swift
public typealias CompletableObserver = (CompletableEvent) -> Void - 
                  
create(subscribe:)Extension methodCreates an observable sequence from a specified subscribe method implementation.
Seealso
Declaration
Swift
public static func create(subscribe: @escaping (@escaping CompletableObserver) -> Disposable) -> PrimitiveSequence<TraitType, ElementType>Parameters
subscribeImplementation of the resulting observable sequence’s
subscribemethod.Return Value
The observable sequence with the specified implementation for the
subscribemethod. - 
                  
subscribe(_:)Extension methodSubscribes
observerto receive events for this sequence.Declaration
Swift
public func subscribe(_ observer: @escaping (CompletableEvent) -> Void) -> DisposableReturn Value
Subscription for
observerthat can be used to cancel production of sequence elements and free resources. - 
                  
subscribe(onCompleted:onError:)Extension methodSubscribes a completion handler and an error handler for this sequence.
Declaration
Swift
public func subscribe(onCompleted: (() -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil) -> DisposableParameters
onCompletedAction to invoke upon graceful termination of the observable sequence.
onErrorAction to invoke upon errored termination of the observable sequence.
Return Value
Subscription object used to unsubscribe from the observable sequence.
 
- 
                  
error(_:)Extension methodReturns an observable sequence that terminates with an
error.Seealso
Declaration
Swift
public static func error(_ error: Swift.Error) -> CompletableReturn Value
The observable sequence that terminates with specified error.
 - 
                  
never()Extension methodReturns a non-terminating observable sequence, which can be used to denote an infinite duration.
Seealso
Declaration
Swift
public static func never() -> CompletableReturn Value
An observable sequence whose observers will never get called.
 - 
                  
empty()Extension methodReturns an empty observable sequence, using the specified scheduler to send out the single
Completedmessage.Seealso
Declaration
Swift
public static func empty() -> CompletableReturn Value
An observable sequence with no elements.
 
- 
                  
do(onError:onCompleted:onSubscribe:onSubscribed:onDispose:)Extension methodInvokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence.
Seealso
Declaration
Swift
public func `do`(onError: ((Swift.Error) throws -> Void)? = nil, onCompleted: (() throws -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = nil) -> CompletableParameters
onNextAction to invoke for each element in the observable sequence.
onErrorAction to invoke upon errored termination of the observable sequence.
onCompletedAction to invoke upon graceful termination of the observable sequence.
onSubscribeAction to invoke before subscribing to source observable sequence.
onSubscribedAction to invoke after subscribing to source observable sequence.
onDisposeAction to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed.
Return Value
The source sequence with the side-effecting behavior applied.
 - 
                  
concat(_:)Extension methodConcatenates the second observable sequence to
selfupon successful termination ofself.Seealso
Declaration
Swift
public func concat(_ second: Completable) -> CompletableParameters
secondSecond observable sequence.
Return Value
An observable sequence that contains the elements of
self, followed by those of the second sequence. - 
                  
concat(_:)Extension methodConcatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.
Seealso
Declaration
Swift
public static func concat<S: Sequence>(_ sequence: S) -> Completable where S.Iterator.Element == CompletableReturn Value
An observable sequence that contains the elements of each given sequence, in sequential order.
 - 
                  
concat(_:)Extension methodConcatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.
Seealso
Declaration
Swift
public static func concat<C: Collection>(_ collection: C) -> Completable where C.Iterator.Element == CompletableReturn Value
An observable sequence that contains the elements of each given sequence, in sequential order.
 - 
                  
concat(_:)Extension methodConcatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.
Seealso
Declaration
Swift
public static func concat(_ sources: Completable...) -> CompletableReturn Value
An observable sequence that contains the elements of each given sequence, in sequential order.
 - 
                  
merge(_:)Extension methodMerges elements from all observable sequences from collection into a single observable sequence.
Seealso
Declaration
Swift
public static func merge<C: Collection>(_ sources: C) -> Completable where C.Iterator.Element == CompletableParameters
sourcesCollection of observable sequences to merge.
Return Value
The observable sequence that merges the elements of the observable sequences.
 - 
                  
merge(_:)Extension methodMerges elements from all observable sequences from array into a single observable sequence.
Seealso
Declaration
Swift
public static func merge(_ sources: [Completable]) -> CompletableParameters
sourcesArray of observable sequences to merge.
Return Value
The observable sequence that merges the elements of the observable sequences.
 - 
                  
merge(_:)Extension methodMerges elements from all observable sequences into a single observable sequence.
Seealso
Declaration
Swift
public static func merge(_ sources: Completable...) -> CompletableParameters
sourcesCollection of observable sequences to merge.
Return Value
The observable sequence that merges the elements of the observable sequences.
 
- 
                  
MaybeObserverExtension methodUndocumented
Declaration
Swift
public typealias MaybeObserver = (MaybeEvent<ElementType>) -> Void - 
                  
create(subscribe:)Extension methodCreates an observable sequence from a specified subscribe method implementation.
Seealso
Declaration
Swift
public static func create(subscribe: @escaping (@escaping MaybeObserver) -> Disposable) -> PrimitiveSequence<TraitType, ElementType>Parameters
subscribeImplementation of the resulting observable sequence’s
subscribemethod.Return Value
The observable sequence with the specified implementation for the
subscribemethod. - 
                  
subscribe(_:)Extension methodSubscribes
observerto receive events for this sequence.Declaration
Swift
public func subscribe(_ observer: @escaping (MaybeEvent<ElementType>) -> Void) -> DisposableReturn Value
Subscription for
observerthat can be used to cancel production of sequence elements and free resources. - 
                  
subscribe(onSuccess:onError:onCompleted:)Extension methodSubscribes a success handler, an error handler, and a completion handler for this sequence.
Declaration
Swift
public func subscribe(onSuccess: ((ElementType) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil) -> DisposableParameters
onSuccessAction to invoke for each element in the observable sequence.
onErrorAction to invoke upon errored termination of the observable sequence.
onCompletedAction to invoke upon graceful termination of the observable sequence.
Return Value
Subscription object used to unsubscribe from the observable sequence.
 
- 
                  
just(_:)Extension methodReturns an observable sequence that contains a single element.
Seealso
Declaration
Swift
public static func just(_ element: ElementType) -> Maybe<ElementType>Parameters
elementSingle element in the resulting observable sequence.
Return Value
An observable sequence containing the single specified element.
 - 
                  
just(_:scheduler:)Extension methodReturns an observable sequence that contains a single element.
Seealso
Declaration
Swift
public static func just(_ element: ElementType, scheduler: ImmediateSchedulerType) -> Maybe<ElementType>Parameters
elementSingle element in the resulting observable sequence.
schedulerScheduler to send the single element on.
Return Value
An observable sequence containing the single specified element.
 - 
                  
error(_:)Extension methodReturns an observable sequence that terminates with an
error.Seealso
Declaration
Swift
public static func error(_ error: Swift.Error) -> Maybe<ElementType>Return Value
The observable sequence that terminates with specified error.
 - 
                  
never()Extension methodReturns a non-terminating observable sequence, which can be used to denote an infinite duration.
Seealso
Declaration
Swift
public static func never() -> Maybe<ElementType>Return Value
An observable sequence whose observers will never get called.
 - 
                  
empty()Extension methodReturns an empty observable sequence, using the specified scheduler to send out the single
Completedmessage.Seealso
Declaration
Swift
public static func empty() -> Maybe<ElementType>Return Value
An observable sequence with no elements.
 
- 
                  
do(onNext:onError:onCompleted:onSubscribe:onSubscribed:onDispose:)Extension methodInvokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence.
Seealso
Declaration
Swift
public func `do`(onNext: ((ElementType) throws -> Void)? = nil, onError: ((Swift.Error) throws -> Void)? = nil, onCompleted: (() throws -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = nil) -> Maybe<ElementType>Parameters
onNextAction to invoke for each element in the observable sequence.
onErrorAction to invoke upon errored termination of the observable sequence.
onCompletedAction to invoke upon graceful termination of the observable sequence.
onSubscribeAction to invoke before subscribing to source observable sequence.
onSubscribedAction to invoke after subscribing to source observable sequence.
onDisposeAction to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed.
Return Value
The source sequence with the side-effecting behavior applied.
 - 
                  
filter(_:)Extension methodFilters the elements of an observable sequence based on a predicate.
Seealso
Declaration
Swift
public func filter(_ predicate: @escaping (ElementType) throws -> Bool) -> Maybe<ElementType>Parameters
predicateA function to test each source element for a condition.
Return Value
An observable sequence that contains elements from the input sequence that satisfy the condition.
 - 
                  
map(_:)Extension methodProjects each element of an observable sequence into a new form.
Seealso
Declaration
Swift
public func map<R>(_ transform: @escaping (ElementType) throws -> R) -> Maybe<R>Parameters
transformA transform function to apply to each source element.
Return Value
An observable sequence whose elements are the result of invoking the transform function on each element of source.
 - 
                  
flatMap(_:)Extension methodProjects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Seealso
Declaration
Swift
public func flatMap<R>(_ selector: @escaping (ElementType) throws -> Maybe<R>) -> Maybe<R>Parameters
selectorA transform function to apply to each element.
Return Value
An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
 - 
                  
ifEmpty(default:)Extension methodEmits elements from the source observable sequence, or a default element if the source observable sequence is empty.
Declaration
Swift
public func ifEmpty(default: ElementType) -> Single<ElementType>Parameters
defaultDefault element to be sent if the source does not emit any elements
Return Value
An observable sequence which emits default element end completes in case the original sequence is empty
 - 
                  
ifEmpty(switchTo:)Extension methodReturns the elements of the specified sequence or
switchTosequence if the sequence is empty.Declaration
Swift
public func ifEmpty(switchTo other: Maybe<ElementType>) -> Maybe<ElementType>Parameters
switchToObservable sequence being returned when source sequence is empty.
Return Value
Observable sequence that contains elements from switchTo sequence if source is empty, otherwise returns source sequence elements.
 - 
                  
ifEmpty(switchTo:)Extension methodReturns the elements of the specified sequence or
switchTosequence if the sequence is empty.Declaration
Swift
public func ifEmpty(switchTo other: Single<ElementType>) -> Single<ElementType>Parameters
switchToObservable sequence being returned when source sequence is empty.
Return Value
Observable sequence that contains elements from switchTo sequence if source is empty, otherwise returns source sequence elements.
 - 
                  
catchErrorJustReturn(_:)Extension methodContinues an observable sequence that is terminated by an error with a single element.
Seealso
Declaration
Swift
public func catchErrorJustReturn(_ element: ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
elementLast element in an observable sequence in case error occurs.
Return Value
An observable sequence containing the source sequence’s elements, followed by the
elementin case an error occurred. 
- 
                  
zip(_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, resultSelector: @escaping (E1, E2) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>) -> PrimitiveSequence<TraitType, (E1, E2)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, resultSelector: @escaping (E1, E2) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>) -> PrimitiveSequence<TraitType, (E1, E2)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, resultSelector: @escaping (E1, E2, E3) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>) -> PrimitiveSequence<TraitType, (E1, E2, E3)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, resultSelector: @escaping (E1, E2, E3) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>) -> PrimitiveSequence<TraitType, (E1, E2, E3)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, resultSelector: @escaping (E1, E2, E3, E4) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, resultSelector: @escaping (E1, E2, E3, E4) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, resultSelector: @escaping (E1, E2, E3, E4, E5) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, resultSelector: @escaping (E1, E2, E3, E4, E5) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5, E6)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5, E6)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6, E7) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5, E6, E7)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6, E7) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5, E6, E7)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7, E8>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>, _ source8: PrimitiveSequence<TraitType, E8>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6, E7, E8) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7, E8>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>, _ source8: PrimitiveSequence<TraitType, E8>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5, E6, E7, E8)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:_:resultSelector:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7, E8>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>, _ source8: PrimitiveSequence<TraitType, E8>, resultSelector: @escaping (E1, E2, E3, E4, E5, E6, E7, E8) throws -> ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
zip(_:_:_:_:_:_:_:_:)Extension methodMerges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index.
Seealso
Declaration
Swift
public static func zip<E1, E2, E3, E4, E5, E6, E7, E8>(_ source1: PrimitiveSequence<TraitType, E1>, _ source2: PrimitiveSequence<TraitType, E2>, _ source3: PrimitiveSequence<TraitType, E3>, _ source4: PrimitiveSequence<TraitType, E4>, _ source5: PrimitiveSequence<TraitType, E5>, _ source6: PrimitiveSequence<TraitType, E6>, _ source7: PrimitiveSequence<TraitType, E7>, _ source8: PrimitiveSequence<TraitType, E8>) -> PrimitiveSequence<TraitType, (E1, E2, E3, E4, E5, E6, E7, E8)>Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 
- 
                  
timer(_:scheduler:)Extension methodReturns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers.
Seealso
Declaration
Swift
public static func timer(_ dueTime: RxTimeInterval, scheduler: SchedulerType) -> PrimitiveSequence<TraitType, ElementType>Parameters
dueTimeRelative time at which to produce the first value.
schedulerScheduler to run timers on.
Return Value
An observable sequence that produces a value after due time has elapsed and then each period.
 
- 
                  
SingleObserverExtension methodUndocumented
Declaration
Swift
public typealias SingleObserver = (SingleEvent<ElementType>) -> Void - 
                  
create(subscribe:)Extension methodCreates an observable sequence from a specified subscribe method implementation.
Seealso
Declaration
Swift
public static func create(subscribe: @escaping (@escaping SingleObserver) -> Disposable) -> Single<ElementType>Parameters
subscribeImplementation of the resulting observable sequence’s
subscribemethod.Return Value
The observable sequence with the specified implementation for the
subscribemethod. - 
                  
subscribe(_:)Extension methodSubscribes
observerto receive events for this sequence.Declaration
Swift
public func subscribe(_ observer: @escaping (SingleEvent<ElementType>) -> Void) -> DisposableReturn Value
Subscription for
observerthat can be used to cancel production of sequence elements and free resources. - 
                  
subscribe(onSuccess:onError:)Extension methodSubscribes a success handler, and an error handler for this sequence.
Declaration
Swift
public func subscribe(onSuccess: ((ElementType) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil) -> DisposableParameters
onSuccessAction to invoke for each element in the observable sequence.
onErrorAction to invoke upon errored termination of the observable sequence.
Return Value
Subscription object used to unsubscribe from the observable sequence.
 
- 
                  
just(_:)Extension methodReturns an observable sequence that contains a single element.
Seealso
Declaration
Swift
public static func just(_ element: ElementType) -> Single<ElementType>Parameters
elementSingle element in the resulting observable sequence.
Return Value
An observable sequence containing the single specified element.
 - 
                  
just(_:scheduler:)Extension methodReturns an observable sequence that contains a single element.
Seealso
Declaration
Swift
public static func just(_ element: ElementType, scheduler: ImmediateSchedulerType) -> Single<ElementType>Parameters
elementSingle element in the resulting observable sequence.
schedulerScheduler to send the single element on.
Return Value
An observable sequence containing the single specified element.
 - 
                  
error(_:)Extension methodReturns an observable sequence that terminates with an
error.Seealso
Declaration
Swift
public static func error(_ error: Swift.Error) -> Single<ElementType>Return Value
The observable sequence that terminates with specified error.
 - 
                  
never()Extension methodReturns a non-terminating observable sequence, which can be used to denote an infinite duration.
Seealso
Declaration
Swift
public static func never() -> Single<ElementType>Return Value
An observable sequence whose observers will never get called.
 
- 
                  
do(onSuccess:onError:onSubscribe:onSubscribed:onDispose:)Extension methodInvokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence.
Seealso
Declaration
Swift
public func `do`(onSuccess: ((ElementType) throws -> Void)? = nil, onError: ((Swift.Error) throws -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = nil) -> Single<ElementType>Parameters
onSuccessAction to invoke for each element in the observable sequence.
onErrorAction to invoke upon errored termination of the observable sequence.
onSubscribeAction to invoke before subscribing to source observable sequence.
onSubscribedAction to invoke after subscribing to source observable sequence.
onDisposeAction to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed.
Return Value
The source sequence with the side-effecting behavior applied.
 - 
                  
do(onNext:onError:onSubscribe:onSubscribed:onDispose:)Extension methodInvokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence.
Seealso
Declaration
Swift
@available(*, deprecated, renamed: "do(onSuccess:onError:onSubscribe:onSubscribed:onDispose:﹚") public func `do`(onNext: ((ElementType) throws -> Void)?, onError: ((Swift.Error) throws -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = nil) -> Single<ElementType>Parameters
onNextAction to invoke for each element in the observable sequence.
onErrorAction to invoke upon errored termination of the observable sequence.
onSubscribeAction to invoke before subscribing to source observable sequence.
onSubscribedAction to invoke after subscribing to source observable sequence.
onDisposeAction to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed.
Return Value
The source sequence with the side-effecting behavior applied.
 - 
                  
filter(_:)Extension methodFilters the elements of an observable sequence based on a predicate.
Seealso
Declaration
Swift
public func filter(_ predicate: @escaping (ElementType) throws -> Bool) -> Maybe<ElementType>Parameters
predicateA function to test each source element for a condition.
Return Value
An observable sequence that contains elements from the input sequence that satisfy the condition.
 - 
                  
map(_:)Extension methodProjects each element of an observable sequence into a new form.
Seealso
Declaration
Swift
public func map<R>(_ transform: @escaping (ElementType) throws -> R) -> Single<R>Parameters
transformA transform function to apply to each source element.
Return Value
An observable sequence whose elements are the result of invoking the transform function on each element of source.
 - 
                  
flatMap(_:)Extension methodProjects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Seealso
Declaration
Swift
public func flatMap<R>(_ selector: @escaping (ElementType) throws -> Single<R>) -> Single<R>Parameters
selectorA transform function to apply to each element.
Return Value
An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
 - 
                  
flatMapMaybe(_:)Extension methodProjects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Seealso
Declaration
Swift
public func flatMapMaybe<R>(_ selector: @escaping (ElementType) throws -> Maybe<R>) -> Maybe<R>Parameters
selectorA transform function to apply to each element.
Return Value
An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
 - 
                  
flatMapCompletable(_:)Extension methodProjects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Seealso
Declaration
Swift
public func flatMapCompletable(_ selector: @escaping (ElementType) throws -> Completable) -> CompletableParameters
selectorA transform function to apply to each element.
Return Value
An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
 - 
                  
zip(_:_:)Extension methodMerges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
Declaration
Swift
public static func zip<C: Collection, R>(_ collection: C, _ resultSelector: @escaping ([ElementType]) throws -> R) -> PrimitiveSequence<TraitType, R> where C.Iterator.Element == PrimitiveSequence<TraitType, ElementType>Parameters
resultSelectorFunction to invoke for each series of elements at corresponding indexes in the sources.
Return Value
An observable sequence containing the result of combining elements of the sources using the specified result selector function.
 - 
                  
zip(_:)Extension methodMerges the specified observable sequences into one observable sequence all of the observable sequences have produced an element at a corresponding index.
Declaration
Swift
public static func zip<C>(_ collection: C) -> PrimitiveSequence<TraitType, [ElementType]> where C : Collection, C.Element == PrimitiveSequence<SingleTrait, Self.ElementType>Return Value
An observable sequence containing the result of combining elements of the sources.
 - 
                  
catchErrorJustReturn(_:)Extension methodContinues an observable sequence that is terminated by an error with a single element.
Seealso
Declaration
Swift
public func catchErrorJustReturn(_ element: ElementType) -> PrimitiveSequence<TraitType, ElementType>Parameters
elementLast element in an observable sequence in case error occurs.
Return Value
An observable sequence containing the source sequence’s elements, followed by the
elementin case an error occurred. - 
                  
asMaybe()Extension methodConverts
selftoMaybetrait.Declaration
Swift
public func asMaybe() -> Maybe<ElementType>Return Value
Maybe trait that represents
self. - 
                  
asCompletable()Extension methodConverts
selftoCompletabletrait.Declaration
Swift
public func asCompletable() -> CompletableReturn Value
Completable trait that represents
self. 
        PrimitiveSequenceType Protocol Reference