Subjects

  • Represents a value that changes over time.

    Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.

    See more

    Declaration

    Swift

    public final class BehaviorSubject<Element>
        : Observable<Element>
        , SubjectType
        , ObserverType
        , SynchronizedUnsubscribeType
        , Disposable
  • Represents an object that is both an observable sequence as well as an observer.

    Each notification is broadcasted to all subscribed observers.

    See more

    Declaration

    Swift

    final public class PublishSubject<Element>
        : Observable<Element>
        , SubjectType
        , Cancelable
        , ObserverType
        , SynchronizedUnsubscribeType
  • Represents an object that is both an observable sequence as well as an observer.

    Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.

    See more

    Declaration

    Swift

    public class ReplaySubject<Element>
        : Observable<Element>
        , SubjectType
        , ObserverType
        , Disposable
  • Represents an object that is both an observable sequence as well as an observer.

    See more

    Declaration

    Swift

    public protocol SubjectType : ObservableType
  • Variable is a wrapper for BehaviorSubject.

    Unlike BehaviorSubject it can’t terminate with error, and when variable is deallocated it will complete it’s observable sequence (asObservable).

    See more

    Declaration

    Swift

    public class Variable<Element>