---
title: "updatePredicate(_:completionHandler:)"
framework: homekit
role: symbol
role_heading: Instance Method
path: "homekit/hmeventtrigger/updatepredicate(_:completionhandler:)"
---

# updatePredicate(_:completionHandler:)

Replaces the predicate used to evaluate execution of the scene associated with the event trigger.

## Declaration

```swift
func updatePredicate(_ predicate: NSPredicate?, completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func updatePredicate(_ predicate: NSPredicate?) async throws
```

## Parameters

- `predicate`: The new predicate to use with the event trigger.
- `completion`: A block that executes after processing the request. The block takes the following parameter:

## See Also

### Adding a trigger condition

- [predicate](homekit/hmeventtrigger/predicate.md)
