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

# handler

An optional handler that performs custom evaluation when predicate evaluates as true.

## Declaration

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

## Discussion

Discussion If a handler isn’t provided, the first successful evaluation of the predicate fulfills the expectation. If you provide a handler, the handler can override this default behavior to tailor the conditions that fulfill the expectation.

## See Also

### Handling Predicate Resolution

- [XCTNSPredicateExpectation.Handler](xctest/xctnspredicateexpectation/handler-swift.typealias.md)
