observeKeyValueAsFlow

fun <T> NSObject.observeKeyValueAsFlow(keyPath: String, options: NSKeyValueObservingOptions = NSKeyValueObservingOptionNew): Flow<T>

Starts observing the value of a property using Key-Value observation and returns any updates in a Flow

Return

a Flow containing the T observed at keyPath

Parameters

keyPath

the key path, relative to the object receiving this message, of the property to observe.

options

A combination of the NSKeyValueObservingOptions values that specifies what is included in observation notifications.

Type Parameters

T

the type of the property to be observed

fun <T> NSObject.observeKeyValueAsFlow(keyPath: String, options: NSKeyValueObservingOptions = NSKeyValueObservingOptionNew): Flow<T>

Starts observing the value of a property using Key-Value observation and returns any updates in a Flow

Return

a Flow containing the T observed at keyPath

Parameters

keyPath

the key path, relative to the object receiving this message, of the property to observe.

options

A combination of the NSKeyValueObservingOptions values that specifies what is included in observation notifications.

Type Parameters

T

the type of the property to be observed