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.