init(keyPath:object:expectedValue:options:)
Creates an expectation with custom observation options that a KVO change fulfills when it causes the specified key path of the observed object to have an expected value.
Declaration
init(keyPath: String, object: Any, expectedValue: Any?, options: NSKeyValueObservingOptions = [])Parameters
- keyPath:
The key path to observe.
- object:
The object to observe.
- expectedValue:
The expected value for the observed key path.
- options:
An array of Nskeyvalueobservingoptions that determine the values to return as part of the observed key path’s change dictionary.