C# Class KNFoundation.KNKVC.KNKVOObservable

Extension methods to provide Key-Value Observing methods to objects.
Datei anzeigen Open project: bt-browser/KNFoundation

Public Methods

Method Description
AddObserverToKeyPathWithOptions ( this o, KNKVOObserver observer, String keyPath, KNKeyValueObservingOptions options, Object context ) : void

Adds an observer to a KVO-compliant key path of the receiver.

DidChangeValueForKey ( this o, String key ) : void

If a given property doesn't support auto-KVO, this MUST be called after changing a value for the property to be KVO-compliant.

RemoveObserverFromKeyPath ( this o, KNKVOObserver observer, String keyPath ) : void

Removes an observer from a KVO-compliant key path of the receiver.

WillChangeValueForKey ( this o, String key ) : void

If a given property doesn't support auto-KVO, this MUST be called before changing a value for the property to be KVO-compliant.

Method Details

AddObserverToKeyPathWithOptions() public static method

Adds an observer to a KVO-compliant key path of the receiver.
public static AddObserverToKeyPathWithOptions ( this o, KNKVOObserver observer, String keyPath, KNKeyValueObservingOptions options, Object context ) : void
o this The object to be observed.
observer KNKVOObserver The object to receive the change notifications.
keyPath String The key path to observe.
options KNKeyValueObservingOptions A bitwise-OR of the desired options. See the KNKeyValueObservingOptions enum for details.
context Object A unique context to identify this observation.
return void

DidChangeValueForKey() public static method

If a given property doesn't support auto-KVO, this MUST be called after changing a value for the property to be KVO-compliant.
public static DidChangeValueForKey ( this o, String key ) : void
o this The object that changed its key.
key String The key that changed.
return void

RemoveObserverFromKeyPath() public static method

Removes an observer from a KVO-compliant key path of the receiver.
public static RemoveObserverFromKeyPath ( this o, KNKVOObserver observer, String keyPath ) : void
o this The object to remove the observation from.
observer KNKVOObserver The observer to remove.
keyPath String The key path of the observation to remove.
return void

WillChangeValueForKey() public static method

If a given property doesn't support auto-KVO, this MUST be called before changing a value for the property to be KVO-compliant.
public static WillChangeValueForKey ( this o, String key ) : void
o this The object that will change its key.
key String The key that will change.
return void