Inherits from RACSubject : RACSignal : RACStream : NSObject
Declared in RACBehaviorSubject.h
RACBehaviorSubject.m

Overview

A behavior subject sends the last value it received when it is subscribed to.

Class Methods

behaviorSubjectWithDefaultValue:

Creates a new behavior subject with a default value. If it hasn’t received any values when it gets subscribed to, it sends the default value.

+ (instancetype)behaviorSubjectWithDefaultValue:(id)value

Declared In

RACBehaviorSubject.h

Instance Methods

sendNext:

Send the next value to subscribers.

- (void)sendNext:(id)value

Discussion

value - The value to send. This can be nil.

Declared In

RACSubscriber.h

subscribe:

Subscribes subscriber to changes on the receiver. The receiver defines which events it actually sends and in what situations the events are sent.

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

Discussion

Subscription will always happen on a valid RACScheduler. If the [RACScheduler currentScheduler] cannot be determined at the time of subscription (e.g., because the calling code is running on a GCD queue or NSOperationQueue), subscription will occur on a private background scheduler. On the main thread, subscriptions will always occur immediately, with a [RACScheduler currentScheduler] of [RACScheduler mainThreadScheduler].

This method must be overridden by any subclasses.

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