Inherits from NSObject
Declared in RACKVOProxy.h

Overview

A singleton that can act as a proxy between a KVO observation and a RAC subscriber, in order to protect against KVO lifetime issues.

Tasks

Class Methods

sharedProxy

+ (instancetype)sharedProxy
Discussion

Returns the singleton KVO proxy object.

Declared In

RACKVOProxy.h

Instance Methods

addObserver:forContext:

- (void)addObserver:(__weak NSObject *)observer forContext:(void *)context
Discussion

Registers an observer with the proxy, such that when the proxy receives a KVO change with the given context, it forwards it to the observer.

observer - True observer of the KVO change. Must not be nil. context - Arbitrary context object used to differentiate multiple observations of the same keypath. Must be unique, cannot be nil.

Declared In

RACKVOProxy.h

removeObserver:forContext:

- (void)removeObserver:(NSObject *)observer forContext:(void *)context
Discussion

Removes an observer from the proxy. Parameters must match those passed to addObserver:forContext:.

observer - True observer of the KVO change. Must not be nil. context - Arbitrary context object used to differentiate multiple observations of the same keypath. Must be unique, cannot be nil.

Declared In

RACKVOProxy.h