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

# init(primary:secondary:)

Creates a capture event interaction with handlers that respond independently to presses of hardware buttons.

## Declaration

```swift
init(primary primaryHandler: @escaping (AVCaptureEvent) -> Void, secondary secondaryHandler: @escaping (AVCaptureEvent) -> Void)
```

## Parameters

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

## See Also

### Creating an interaction

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