An expectation that is fulfilled when a Key Value Observing (KVO) condition is met.
SDK
- Xcode 8.3+
Framework
- XCTest
Declaration
class XCTKVOExpectation : XCTest Expectation
An expectation that is fulfilled when a Key Value Observing (KVO) condition is met.
SDK
Framework
class XCTKVOExpectation : XCTest Expectation
init(key Path: String, object: Any)
Creates an expectation that is fulfilled by any KVO change to the specified key path of the observed object.
init(key Path: String, object: Any, expected Value: Any?)
Creates an expectation that is fulfilled when a KVO change causes the specified key path of the observed object to have an expected value.
init(key Path: String, object: Any, expected Value: Any?, options: NSKey Value Observing Options)
Creates an expectation that is fulfilled when a KVO change causes the specified key path of the observed object to have an expected value. Allows custom observation options to be provided by the caller.
var key Path: String
The key path that is being observed for KVO changes.
var observed Object: Any
The object that is being observed for KVO changes.
var expected Value: Any?
The value that the expectation is waiting for the observed key path to take.
var options: NSKey Value Observing Options
The NSKey
used when registering for observation.
var handler: XCTKVOExpectation .Handler?
An optional handler that performs custom evaluation of changes to the observed key path.
typealias XCTKVOExpectation .Handler
A custom handler to be called when a KVO change is observed for a specified key path.