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

# updateEndEvents(_:completionHandler:)

Updates the set of end events associated with the event trigger.

## Declaration

```swift
func updateEndEvents(_ endEvents: [HMEvent], completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func updateEndEvents(_ endEvents: [HMEvent]) async throws
```

## Parameters

- `endEvents`: An array of events that replaces the end events on the trigger.
- `completion`: A block that executes after processing the request. The block takes the following parameter:

## See Also

### Restoring the previous scene after an event

- [endEvents](homekit/hmeventtrigger/endevents.md)
