<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "tvOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTKeyPathExpectation/init(keyPath:observedObject:options:filter:)-8noag",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "s:6XCTest21XCTKeyPathExpectationCAAs8SendableRzsADR_rlE03keyC014observedObject7options6filterACyxq_Gs03KeyC0Cyxq_G_xSo26NSKeyValueObservingOptionsVSbx_10Foundation0lM14ObservedChangeVyq_GtYaYbcSgtcfc"
  },
  "title" : "init(keyPath:observedObject:options:filter:)"
}
-->

# init(keyPath:observedObject:options:filter:)

```
convenience init(keyPath: KeyPath<T, V>, observedObject: T, options: NSKeyValueObservingOptions = [.initial, .new, .old], filter: XCTKeyPathExpectation<T, V>.AsynchronousFilter? = nil)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)