Initializer

init(object:keyPath:options:)

Creates a key-value observing publisher for the given combination of object and key path, using publishing behavior options you provide.

Declaration

init(object: Subject, keyPath: KeyPath<Subject, Value>, options: NSKeyValueObservingOptions)

Parameters

object

The object that contains the property to publish.

keyPath

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

options

Options that determine which elements the publisher produces. Set this parameter to [] to receive new elements when the observed property changes.

Discussion

This publisher produces a new element every time the observed property changes.