CollectionType

protocol CollectionType : Indexable, SequenceType
  • Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.

    Declaration

    Swift

    public func combineLatest<R>(resultSelector: [Generator.Element.E] throws -> R) -> Observable<R>

    Parameters

    resultSelector

    Function to invoke whenever any of the sources produces an element.

    Return Value

    An observable sequence containing the result of combining elements of the sources using the specified result selector function.

  • Merges 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 func zip<R>(resultSelector: [Generator.Element.E] throws -> R) -> Observable<R>

    Parameters

    resultSelector

    Function 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.

  • Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully.

    This operator has tail recursive optimizations that will prevent stack overflow and enable generating infinite observable sequences while using limited amount of memory during generation.

    Optimizations will be performed in cases equivalent to following:

    [1, [2, [3, .....].concat()].concat].concat()
    

    Declaration

    Swift

    public func concat()
            -> Observable<Generator.Element.E>

    Return Value

    An observable sequence that contains the elements of each given sequence, in sequential order.