---
title: "init(handler:)"
framework: avkit
role: symbol
role_heading: Initializer
path: "avkit/avcaptureeventinteraction/init(handler:)"
---

# init(handler:)

Creates a capture event interaction with a handler that responds to presses of hardware buttons.

## Declaration

```swift
init(handler: @escaping (AVCaptureEvent) -> Void)
```

## Parameters

- `handler`: An event handler the system calls when a person performs a primary or secondary capture event.

## See Also

### Creating an interaction

- [init(primary:secondary:)](avkit/avcaptureeventinteraction/init(primary:secondary:).md)
