Inherits from RACStream : NSObject
Declared in RACSignal.h

Overview

The error code used when a value passed into switch:cases:default: does not match any of the cases, and no default was given. Additional methods to assist with debugging. These methods should never ship in production code.

Tasks

Other Methods

  • + createSignal:

    Note: The didSubscribe block is called every time a new subscriber subscribes. Any side effects within the block will thus execute once for each subscription, not necessarily on one thread, and possibly even simultaneously!

  • + error:

    Returns a signal that immediately sends the given error.

  • + never

    Returns a signal that never completes.

  • + startEagerlyWithScheduler:block:

    Returns a signal which will send all events sent on the subscriber given to block. All events will be sent on scheduler and it will replay any missed events to new subscribers.

  • + startLazilyWithScheduler:block:

    Returns a signal which will pass through the events sent to the subscriber given to block and replay any missed events to new subscribers.

Deprecated Methods

Subscription Methods

Operations Methods

  • – doNext:

    Do the given block on next. This should be used to inject side effects into the signal.

  • – doError:

    Do the given block on error. This should be used to inject side effects into the signal.

  • – doCompleted:

    Do the given block on completed. This should be used to inject side effects into the signal.

  • – throttle:

    Returns a signal which sends throttled and delayed next events. Completion and errors are always forwarded immediately.

  • – throttle:valuesPassingTest:

    Returns a signal which sends next events, throttled when predicate returns YES. Completion and errors are always forwarded immediately.

  • – delay:

    Returns a signal which sends delayed next and completed events. Errors are always forwarded immediately.

  • – repeat

    Resubscribes when the signal completes.

  • – initially:

    Returns a signal that passes through all events of the receiver, plus introduces side effects which occur prior to any subscription side effects of the receiver.

  • – finally:

    Executes the given block when the signal completes or errors.

  • – bufferWithTime:onScheduler:

    Returns a signal which sends RACTuples of the buffered values at each interval on scheduler. When the receiver completes, any currently-buffered values will be sent immediately.

  • – collect

    Returns a signal which sends a single NSArray when the receiver completes successfully.

  • – takeLast:

    Takes the last count nexts after the receiving signal completes.

  • – combineLatestWith:

    Returns a signal which sends RACTuples of the combined values, forwards any error events, and completes when both input signals complete.

  • + combineLatest:

    Returns a signal which sends RACTuples of the combined values, forwards any error events, and completes when all input signals complete.

  • + combineLatest:reduce:

    Returns a signal which sends the results from each invocation of reduceBlock.

  • – merge:

    Merges the receiver and the given signal with +merge: and returns the resulting signal.

  • + merge:

    Returns a signal that passes through values from each of the given signals, and sends completed when all of them complete. If any signal sends an error, the returned signal sends error immediately.

  • – flatten:

    maxConcurrent - the maximum number of signals to subscribe to at a time. If 0, it subscribes to an unlimited number of signals.

  • – then:

    Returns a signal which will pass through the events of the signal created in block. If the receiver errors out, the returned signal will error as well.

  • – concat

    Concats the inner signals of a signal of signals.

  • – aggregateWithStart:reduce:

    Returns a signal that will send the aggregated value when the receiver completes, then itself complete. If the receiver never sends any values, start will be sent instead.

  • – aggregateWithStart:reduceWithIndex:

    Returns a signal that will send the aggregated value when the receiver completes, then itself complete. If the receiver never sends any values, start will be sent instead.

  • – aggregateWithStartFactory:reduce:

    Returns a signal that will send the aggregated value when the receiver completes, then itself complete. If the receiver never sends any values, the return value of startFactory will be sent instead.

  • – setKeyPath:onObject:

    WARNING: Under certain conditions, this method is known to be thread-unsafe. See the description in setKeyPath:onObject:nilValue:.

  • – setKeyPath:onObject:nilValue:

    Returns a disposable which can be used to terminate the binding.

  • + interval:onScheduler:

    Returns a signal that sends the current date/time every interval on scheduler.

  • + interval:onScheduler:withLeeway:

    Returns a signal that sends the current date/time at intervals of at least interval seconds up to approximately interval + leeway seconds on scheduler.

  • – takeUntil:

    Returns a signal which passes through all events from the receiver until signalTrigger sends next or completed, at which point the returned signal will send completed.

  • – takeUntilReplacement:

    Returns a signal which passes through nexts and error from the receiver until replacement sends an event, at which point the returned signal will send that event and switch to passing through events from replacement instead, regardless of whether the receiver has sent events already.

  • – catch:

    Subscribes to the returned signal when an error occurs.

  • – catchTo:

    Subscribes to the given signal when an error occurs.

  • – try:

    Returns a signal which passes through all the values of the receiver. If tryBlock fails for any value, the returned signal will error using the NSError passed out from the block.

  • – tryMap:

    Returns a signal which transforms all the values of the receiver. If mapBlock returns nil for any value, the returned signal will error using the NSError passed out from the block.

  • – first

    Returns the first next. Note that this is a blocking call.

  • – firstOrDefault:

    Returns the first next or defaultValue if the signal completes or errors without sending a next. Note that this is a blocking call.

  • – firstOrDefault:success:error:

    Both success and error may be NULL.

  • – waitUntilCompleted:

    Returns whether the signal completed successfully. If NO, error will be set to the error that occurred.

  • + defer:

    This can be used to effectively turn a hot signal into a cold signal.

  • – switchToLatest

    Returns a signal which passes through nexts and errors from the latest signal sent by the receiver, and sends completed when both the receiver and the last sent signal complete.

  • + switch:cases:default:

    Returns a signal which passes through nexts and errors from one of the the signals in cases or defaultSignal, and sends completed when both signal and the last used signal complete. If no defaultSignal is given, an unmatched next will result in an error on the returned signal.

  • + if:then:else:

    Returns a signal which passes through nexts and errors from trueSignal and/or falseSignal, and sends completed when both boolSignal and the last switched signal complete.

  • – toArray

    Returns the array of next values, or nil if an error occurs.

  •   sequence

    Returns a sequence which provides values from the signal as they’re sent. Trying to retrieve a value from the sequence which has not yet been sent will block.

    property
  • – publish

    Creates and returns a multicast connection. This allows you to share a single subscription to the underlying signal.

  • – multicast:

    Creates and returns a multicast connection that pushes values into the given subject. This allows you to share a single subscription to the underlying signal.

  • – replay

    Returns the connected, multicasted signal.

  • – replayLast

    Returns the connected, multicasted signal.

  • – replayLazily

    Returns the lazily connected, multicasted signal.

  • – timeout:onScheduler:

    Returns a signal that passes through the receiver’s events, until the stream finishes or times out, at which point an error will be sent on scheduler.

  • – deliverOn:

    This corresponds to the ObserveOn method in Rx.

  • – subscribeOn:

    Use of this operator should be avoided whenever possible, because the receiver’s side effects may not be safe to run on another thread. If you just want to receive the signal’s events on scheduler, use deliverOn: instead.

  • – groupBy:transform:

    The returned signal is a signal of RACGroupedSignal.

  • – groupBy:

    Calls -[RACSignal groupBy:keyBlock transform:nil].

  • – any

    Sends an [NSNumber numberWithBool:YES] if the receiving signal sends any objects.

  • – any:

    predicateBlock - cannot be nil.

  • – all:

    predicateBlock - cannot be nil.

  • – retry:

    retryCount - if 0, it keeps retrying until it completes.

  • – retry

    Resubscribes to the receiving signal if an error occurs.

  • – sample:

    sampler - The signal that controls when the latest value from the receiver is sent. Cannot be nil.

  • – ignoreValues

    Returns a signal which only passes through error or completed events from the receiver.

  • – materialize

    Returns a signal which sends the receiver’s events as RACEvents, and completes after the receiver sends completed or error.

  • – dematerialize

    Returns a signal which sends next for each value RACEvent, error for each error RACEvent, and completed for each completed RACEvent.

  • – not

    Returns a signal of inverted NSNumber-wrapped BOOLs.

  • – and

    Returns a signal that applies AND to each NSNumber in the tuple.

  • – or

    Asserts if the receiver sends anything other than a RACTuple of one or more NSNumbers.

Debugging Methods

OperationsDeprecated Methods

RACStream Methods

  • + return:

    Returns a signal that immediately sends the given value and then completes.

  • + empty

    Returns a signal that immediately completes.

  • – concat:

    Subscribes to signal when the source signal completes.

  • – zipWith:

    Returns a new signal of RACTuples, representing the combined values of the two signals. Any error from one of the original signals will be forwarded on the returned signal.

Testing Methods

Properties

sequence

@property (nonatomic, strong, readonly) RACSequence *sequence
Discussion

Returns a sequence which provides values from the signal as they’re sent. Trying to retrieve a value from the sequence which has not yet been sent will block.

Declared In

RACSignal+Operations.h

Class Methods

combineLatest:

+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals
Discussion

Returns a signal which sends RACTuples of the combined values, forwards any error events, and completes when all input signals complete.

Declared In

RACSignal+Operations.h

combineLatest:reduce:

+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals reduce:(id ( ^ ) ( ))reduceBlock
Discussion

Returns a signal which sends the results from each invocation of reduceBlock.

Declared In

RACSignal+Operations.h

createSignal:

+ (RACSignal *)createSignal:(RACDisposable *( ^ ) ( id<RACSubscriber> subscriber ))didSubscribe
Discussion

Note: The didSubscribe block is called every time a new subscriber subscribes. Any side effects within the block will thus execute once for each subscription, not necessarily on one thread, and possibly even simultaneously!

Declared In

RACSignal.h

defer:

+ (RACSignal *)defer:(RACSignal *( ^ ) ( void ))block
Discussion

This can be used to effectively turn a hot signal into a cold signal.

Declared In

RACSignal+Operations.h

empty

+ (RACSignal *)empty
Discussion

Returns a signal that immediately completes.

Declared In

RACSignal.h

error:

+ (RACSignal *)error:(NSError *)error
Discussion

Returns a signal that immediately sends the given error.

Declared In

RACSignal.h

if:then:else:

+ (RACSignal *)if:(RACSignal *)boolSignal then:(RACSignal *)trueSignal else:(RACSignal *)falseSignal
Discussion

Returns a signal which passes through nexts and errors from trueSignal and/or falseSignal, and sends completed when both boolSignal and the last switched signal complete.

Declared In

RACSignal+Operations.h

interval:

+ (RACSignal *)interval:(NSTimeInterval)interval

interval:onScheduler:

+ (RACSignal *)interval:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler
Discussion

Returns a signal that sends the current date/time every interval on scheduler.

Declared In

RACSignal+Operations.h

interval:onScheduler:withLeeway:

+ (RACSignal *)interval:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler withLeeway:(NSTimeInterval)leeway
Discussion

Returns a signal that sends the current date/time at intervals of at least interval seconds up to approximately interval + leeway seconds on scheduler.

Declared In

RACSignal+Operations.h

interval:withLeeway:

+ (RACSignal *)interval:(NSTimeInterval)interval withLeeway:(NSTimeInterval)leeway

merge:

+ (RACSignal *)merge:(id<NSFastEnumeration>)signals
Discussion

Returns a signal that passes through values from each of the given signals, and sends completed when all of them complete. If any signal sends an error, the returned signal sends error immediately.

Declared In

RACSignal+Operations.h

never

+ (RACSignal *)never
Discussion

Returns a signal that never completes.

Declared In

RACSignal.h

return:

+ (RACSignal *)return:(id)value
Discussion

Returns a signal that immediately sends the given value and then completes.

Declared In

RACSignal.h

start:

+ (RACSignal *)start:(id ( ^ ) ( BOOL *success , NSError **error ))block

startEagerlyWithScheduler:block:

+ (RACSignal *)startEagerlyWithScheduler:(RACScheduler *)scheduler block:(void ( ^ ) ( id<RACSubscriber> subscriber ))block
Discussion

Returns a signal which will send all events sent on the subscriber given to block. All events will be sent on scheduler and it will replay any missed events to new subscribers.

Declared In

RACSignal.h

startLazilyWithScheduler:block:

+ (RACSignal *)startLazilyWithScheduler:(RACScheduler *)scheduler block:(void ( ^ ) ( id<RACSubscriber> subscriber ))block
Discussion

Returns a signal which will pass through the events sent to the subscriber given to block and replay any missed events to new subscribers.

Declared In

RACSignal.h

startWithScheduler:block:

+ (RACSignal *)startWithScheduler:(RACScheduler *)scheduler block:(id ( ^ ) ( BOOL *success , NSError **error ))block

startWithScheduler:subjectBlock:

+ (RACSignal *)startWithScheduler:(RACScheduler *)scheduler subjectBlock:(void ( ^ ) ( RACSubject *subject ))block

switch:cases:default:

+ (RACSignal *)switch:(RACSignal *)signal cases:(NSDictionary *)cases default:(RACSignal *)defaultSignal
Discussion

Returns a signal which passes through nexts and errors from one of the the signals in cases or defaultSignal, and sends completed when both signal and the last used signal complete. If no defaultSignal is given, an unmatched next will result in an error on the returned signal.

Declared In

RACSignal+Operations.h

Instance Methods

aggregateWithStart:combine:

- (RACSignal *)aggregateWithStart:(id)start combine:(id ( ^ ) ( id running , id next ))combineBlock

aggregateWithStart:reduce:

- (RACSignal *)aggregateWithStart:(id)start reduce:(id ( ^ ) ( id running , id next ))reduceBlock
Discussion

Returns a signal that will send the aggregated value when the receiver completes, then itself complete. If the receiver never sends any values, start will be sent instead.

Declared In

RACSignal+Operations.h

aggregateWithStart:reduceWithIndex:

- (RACSignal *)aggregateWithStart:(id)start reduceWithIndex:(id ( ^ ) ( id running , id next , NSUInteger index ))reduceBlock
Discussion

Returns a signal that will send the aggregated value when the receiver completes, then itself complete. If the receiver never sends any values, start will be sent instead.

Declared In

RACSignal+Operations.h

aggregateWithStartFactory:combine:

- (RACSignal *)aggregateWithStartFactory:(id ( ^ ) ( void ))startFactory combine:(id ( ^ ) ( id running , id next ))combineBlock

aggregateWithStartFactory:reduce:

- (RACSignal *)aggregateWithStartFactory:(id ( ^ ) ( void ))startFactory reduce:(id ( ^ ) ( id running , id next ))reduceBlock
Discussion

Returns a signal that will send the aggregated value when the receiver completes, then itself complete. If the receiver never sends any values, the return value of startFactory will be sent instead.

Declared In

RACSignal+Operations.h

all:

- (RACSignal *)all:(BOOL ( ^ ) ( id object ))predicateBlock
Discussion

predicateBlock - cannot be nil.

Declared In

RACSignal+Operations.h

and

- (RACSignal *)and
Discussion

Returns a signal that applies AND to each NSNumber in the tuple.

Declared In

RACSignal+Operations.h

any

- (RACSignal *)any
Discussion

Sends an [NSNumber numberWithBool:YES] if the receiving signal sends any objects.

Declared In

RACSignal+Operations.h

any:

- (RACSignal *)any:(BOOL ( ^ ) ( id object ))predicateBlock
Discussion

predicateBlock - cannot be nil.

Declared In

RACSignal+Operations.h

asynchronousFirstOrDefault:success:error:

- (id)asynchronousFirstOrDefault:(id)defaultValue success:(BOOL *)success error:(NSError **)error
Discussion

Returns the first value received, or defaultValue if no value is received before the signal finishes or the method times out.

Declared In

RACSignal.h

asynchronouslyWaitUntilCompleted:

- (BOOL)asynchronouslyWaitUntilCompleted:(NSError **)error
Discussion

Returns whether the signal completed successfully before timing out. If NO, error will be set to any error that occurred.

Declared In

RACSignal.h

buffer:

- (RACSignal *)buffer:(NSUInteger)bufferCount

bufferWithTime:

- (RACSignal *)bufferWithTime:(NSTimeInterval)interval

bufferWithTime:onScheduler:

- (RACSignal *)bufferWithTime:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler
Discussion

Returns a signal which sends RACTuples of the buffered values at each interval on scheduler. When the receiver completes, any currently-buffered values will be sent immediately.

Declared In

RACSignal+Operations.h

catch:

- (RACSignal *)catch:(RACSignal *( ^ ) ( NSError *error ))catchBlock
Discussion

Subscribes to the returned signal when an error occurs.

Declared In

RACSignal+Operations.h

catchTo:

- (RACSignal *)catchTo:(RACSignal *)signal
Discussion

Subscribes to the given signal when an error occurs.

Declared In

RACSignal+Operations.h

collect

- (RACSignal *)collect
Discussion

Returns a signal which sends a single NSArray when the receiver completes successfully.

Declared In

RACSignal+Operations.h

combineLatestWith:

- (RACSignal *)combineLatestWith:(RACSignal *)signal
Discussion

Returns a signal which sends RACTuples of the combined values, forwards any error events, and completes when both input signals complete.

Declared In

RACSignal+Operations.h

concat

- (RACSignal *)concat
Discussion

Concats the inner signals of a signal of signals.

Declared In

RACSignal+Operations.h

concat:

- (RACSignal *)concat:(RACSignal *)signal
Discussion

Subscribes to signal when the source signal completes.

Declared In

RACSignal.h

delay:

- (RACSignal *)delay:(NSTimeInterval)interval
Discussion

Returns a signal which sends delayed next and completed events. Errors are always forwarded immediately.

Declared In

RACSignal+Operations.h

deliverOn:

- (RACSignal *)deliverOn:(RACScheduler *)scheduler
Discussion

This corresponds to the ObserveOn method in Rx.

Declared In

RACSignal+Operations.h

dematerialize

- (RACSignal *)dematerialize
Discussion

Returns a signal which sends next for each value RACEvent, error for each error RACEvent, and completed for each completed RACEvent.

Declared In

RACSignal+Operations.h

doCompleted:

- (RACSignal *)doCompleted:(void ( ^ ) ( void ))block
Discussion

Do the given block on completed. This should be used to inject side effects into the signal.

Declared In

RACSignal+Operations.h

doError:

- (RACSignal *)doError:(void ( ^ ) ( NSError *error ))block
Discussion

Do the given block on error. This should be used to inject side effects into the signal.

Declared In

RACSignal+Operations.h

doNext:

- (RACSignal *)doNext:(void ( ^ ) ( id x ))block
Discussion

Do the given block on next. This should be used to inject side effects into the signal.

Declared In

RACSignal+Operations.h

executeCommand:

- (RACDisposable *)executeCommand:(RACCommand *)command

finally:

- (RACSignal *)finally:(void ( ^ ) ( void ))block
Discussion

Executes the given block when the signal completes or errors.

Declared In

RACSignal+Operations.h

first

- (id)first
Discussion

Returns the first next. Note that this is a blocking call.

Declared In

RACSignal+Operations.h

firstOrDefault:

- (id)firstOrDefault:(id)defaultValue
Discussion

Returns the first next or defaultValue if the signal completes or errors without sending a next. Note that this is a blocking call.

Declared In

RACSignal+Operations.h

firstOrDefault:success:error:

- (id)firstOrDefault:(id)defaultValue success:(BOOL *)success error:(NSError **)error
Discussion

Both success and error may be NULL.

Declared In

RACSignal+Operations.h

flatten:

- (RACSignal *)flatten:(NSUInteger)maxConcurrent
Discussion

maxConcurrent - the maximum number of signals to subscribe to at a time. If 0, it subscribes to an unlimited number of signals.

Declared In

RACSignal+Operations.h

groupBy:

- (RACSignal *)groupBy:(id<NSCopying> ( ^ ) ( id object ))keyBlock
Discussion

Calls -[RACSignal groupBy:keyBlock transform:nil].

Declared In

RACSignal+Operations.h

groupBy:transform:

- (RACSignal *)groupBy:(id<NSCopying> ( ^ ) ( id object ))keyBlock transform:(id ( ^ ) ( id object ))transformBlock
Discussion

The returned signal is a signal of RACGroupedSignal.

Declared In

RACSignal+Operations.h

ignoreElements

- (RACSignal *)ignoreElements

ignoreValues

- (RACSignal *)ignoreValues
Discussion

Returns a signal which only passes through error or completed events from the receiver.

Declared In

RACSignal+Operations.h

initially:

- (RACSignal *)initially:(void ( ^ ) ( void ))block
Discussion

Returns a signal that passes through all events of the receiver, plus introduces side effects which occur prior to any subscription side effects of the receiver.

Declared In

RACSignal+Operations.h

let:

- (RACSignal *)let:(RACSignal *( ^ ) ( RACSignal *sharedSignal ))letBlock

logAll

- (RACSignal *)logAll
Discussion

Logs all events that the receiver sends.

Declared In

RACSignal.h

logCompleted

- (RACSignal *)logCompleted
Discussion

Logs any completed event that the receiver sends.

Declared In

RACSignal.h

logError

- (RACSignal *)logError
Discussion

Logs any error that the receiver sends.

Declared In

RACSignal.h

logNext

- (RACSignal *)logNext
Discussion

Logs each next that the receiver sends.

Declared In

RACSignal.h

materialize

- (RACSignal *)materialize
Discussion

Returns a signal which sends the receiver’s events as RACEvents, and completes after the receiver sends completed or error.

Declared In

RACSignal+Operations.h

merge:

- (RACSignal *)merge:(RACSignal *)signal
Discussion

Merges the receiver and the given signal with +merge: and returns the resulting signal.

Declared In

RACSignal+Operations.h

multicast:

- (RACMulticastConnection *)multicast:(RACSubject *)subject
Discussion

Creates and returns a multicast connection that pushes values into the given subject. This allows you to share a single subscription to the underlying signal.

Declared In

RACSignal+Operations.h

not

- (RACSignal *)not
Discussion

Returns a signal of inverted NSNumber-wrapped BOOLs.

Declared In

RACSignal+Operations.h

or

- (RACSignal *)or
Discussion

Asserts if the receiver sends anything other than a RACTuple of one or more NSNumbers.

Returns a signal that applies OR to each NSNumber in the tuple.

Declared In

RACSignal+Operations.h

publish

- (RACMulticastConnection *)publish
Discussion

Creates and returns a multicast connection. This allows you to share a single subscription to the underlying signal.

Declared In

RACSignal+Operations.h

repeat

- (RACSignal *)repeat
Discussion

Resubscribes when the signal completes.

Declared In

RACSignal+Operations.h

replay

- (RACSignal *)replay
Discussion

Returns the connected, multicasted signal.

Declared In

RACSignal+Operations.h

replayLast

- (RACSignal *)replayLast
Discussion

Returns the connected, multicasted signal.

Declared In

RACSignal+Operations.h

replayLazily

- (RACSignal *)replayLazily
Discussion

Returns the lazily connected, multicasted signal.

Declared In

RACSignal+Operations.h

retry

- (RACSignal *)retry
Discussion

Resubscribes to the receiving signal if an error occurs.

Declared In

RACSignal+Operations.h

retry:

- (RACSignal *)retry:(NSInteger)retryCount
Discussion

retryCount - if 0, it keeps retrying until it completes.

Declared In

RACSignal+Operations.h

sample:

- (RACSignal *)sample:(RACSignal *)sampler
Discussion

sampler - The signal that controls when the latest value from the receiver is sent. Cannot be nil.

Declared In

RACSignal+Operations.h

sequenceNext:

- (RACSignal *)sequenceNext:(RACSignal *( ^ ) ( void ))block

setKeyPath:onObject:

- (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object
Discussion

WARNING: Under certain conditions, this method is known to be thread-unsafe. See the description in setKeyPath:onObject:nilValue:.

Declared In

RACSignal+Operations.h

setKeyPath:onObject:nilValue:

- (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object nilValue:(id)nilValue
Discussion

Returns a disposable which can be used to terminate the binding.

Declared In

RACSignal+Operations.h

subscribe:

- (RACDisposable *)subscribe:(id<RACSubscriber>)subscriber
Discussion

Returns nil or a disposable. You can call [RACDisposable dispose] if you need to end your subscription before it would “naturally” end, either by completing or erroring. Once the disposable has been disposed, the subscriber won’t receive any more events from the subscription.

Declared In

RACSignal.h

subscribeCompleted:

- (RACDisposable *)subscribeCompleted:(void ( ^ ) ( void ))completedBlock
Discussion

This corresponds to the IObserver<T>.OnCompleted in Rx.

Declared In

RACSignal.h

subscribeError:

- (RACDisposable *)subscribeError:(void ( ^ ) ( NSError *error ))errorBlock
Discussion

This corresponds to the IObserver<T>.OnError in Rx.

Declared In

RACSignal.h

subscribeError:completed:

- (RACDisposable *)subscribeError:(void ( ^ ) ( NSError *error ))errorBlock completed:(void ( ^ ) ( void ))completedBlock
Discussion

Convenience method to subscribe to error and completed events.

Declared In

RACSignal.h

subscribeNext:

- (RACDisposable *)subscribeNext:(void ( ^ ) ( id x ))nextBlock
Discussion

This corresponds to IObserver<T>.OnNext in Rx.

Declared In

RACSignal.h

subscribeNext:completed:

- (RACDisposable *)subscribeNext:(void ( ^ ) ( id x ))nextBlock completed:(void ( ^ ) ( void ))completedBlock
Discussion

Convenience method to subscribe to the next and completed events.

Declared In

RACSignal.h

subscribeNext:error:

- (RACDisposable *)subscribeNext:(void ( ^ ) ( id x ))nextBlock error:(void ( ^ ) ( NSError *error ))errorBlock
Discussion

Convenience method to subscribe to next and error events.

Declared In

RACSignal.h

subscribeNext:error:completed:

- (RACDisposable *)subscribeNext:(void ( ^ ) ( id x ))nextBlock error:(void ( ^ ) ( NSError *error ))errorBlock completed:(void ( ^ ) ( void ))completedBlock
Discussion

Convenience method to subscribe to the next, completed, and error events.

Declared In

RACSignal.h

subscribeOn:

- (RACSignal *)subscribeOn:(RACScheduler *)scheduler
Discussion

Use of this operator should be avoided whenever possible, because the receiver’s side effects may not be safe to run on another thread. If you just want to receive the signal’s events on scheduler, use deliverOn: instead.

Declared In

RACSignal+Operations.h

switchToLatest

- (RACSignal *)switchToLatest
Discussion

Returns a signal which passes through nexts and errors from the latest signal sent by the receiver, and sends completed when both the receiver and the last sent signal complete.

Declared In

RACSignal+Operations.h

takeLast:

- (RACSignal *)takeLast:(NSUInteger)count
Discussion

Takes the last count nexts after the receiving signal completes.

Declared In

RACSignal+Operations.h

takeUntil:

- (RACSignal *)takeUntil:(RACSignal *)signalTrigger
Discussion

Returns a signal which passes through all events from the receiver until signalTrigger sends next or completed, at which point the returned signal will send completed.

Declared In

RACSignal+Operations.h

takeUntilReplacement:

- (RACSignal *)takeUntilReplacement:(RACSignal *)replacement
Discussion

Returns a signal which passes through nexts and error from the receiver until replacement sends an event, at which point the returned signal will send that event and switch to passing through events from replacement instead, regardless of whether the receiver has sent events already.

Declared In

RACSignal+Operations.h

then:

- (RACSignal *)then:(RACSignal *( ^ ) ( void ))block
Discussion

Returns a signal which will pass through the events of the signal created in block. If the receiver errors out, the returned signal will error as well.

Declared In

RACSignal+Operations.h

throttle:

- (RACSignal *)throttle:(NSTimeInterval)interval
Discussion

Returns a signal which sends throttled and delayed next events. Completion and errors are always forwarded immediately.

Declared In

RACSignal+Operations.h

throttle:valuesPassingTest:

- (RACSignal *)throttle:(NSTimeInterval)interval valuesPassingTest:(BOOL ( ^ ) ( id next ))predicate
Discussion

Returns a signal which sends next events, throttled when predicate returns YES. Completion and errors are always forwarded immediately.

Declared In

RACSignal+Operations.h

timeout:

- (RACSignal *)timeout:(NSTimeInterval)interval

timeout:onScheduler:

- (RACSignal *)timeout:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler
Discussion

Returns a signal that passes through the receiver’s events, until the stream finishes or times out, at which point an error will be sent on scheduler.

Declared In

RACSignal+Operations.h

toArray

- (NSArray *)toArray
Discussion

Returns the array of next values, or nil if an error occurs.

Declared In

RACSignal+Operations.h

toProperty:onObject:

- (RACDisposable *)toProperty:(NSString *)keyPath onObject:(NSObject *)object

try:

- (RACSignal *)try:(BOOL ( ^ ) ( id value , NSError **errorPtr ))tryBlock
Discussion

Returns a signal which passes through all the values of the receiver. If tryBlock fails for any value, the returned signal will error using the NSError passed out from the block.

Declared In

RACSignal+Operations.h

tryMap:

- (RACSignal *)tryMap:(id ( ^ ) ( id value , NSError **errorPtr ))mapBlock
Discussion

Returns a signal which transforms all the values of the receiver. If mapBlock returns nil for any value, the returned signal will error using the NSError passed out from the block.

Declared In

RACSignal+Operations.h

waitUntilCompleted:

- (BOOL)waitUntilCompleted:(NSError **)error
Discussion

Returns whether the signal completed successfully. If NO, error will be set to the error that occurred.

Declared In

RACSignal+Operations.h

windowWithStart:close:

- (RACSignal *)windowWithStart:(RACSignal *)openSignal close:(RACSignal *( ^ ) ( RACSignal *start ))closeBlock

zipWith:

- (RACSignal *)zipWith:(RACSignal *)signal
Discussion

Returns a new signal of RACTuples, representing the combined values of the two signals. Any error from one of the original signals will be forwarded on the returned signal.

Declared In

RACSignal.h