---
title: handler
framework: xctest
role: symbol
role_heading: Instance Property
path: xctest/xctkvoexpectation/handler-swift.property
---

# handler

An optional handler that performs custom evaluation of changes to the observed key path.

## Declaration

```swift
var handler: XCTKVOExpectation.Handler? { get set }
```

## Discussion

Discussion note: The system ignores the expectation’s expectedValue property when the handler is non-nil.

## See Also

### Custom KVO evaluation

- [XCTKVOExpectation.Handler](xctest/xctkvoexpectation/handler-swift.typealias.md)
