---
title: "init(updateHandler:)"
framework: UIKit
role: symbol
role_heading: Initializer
platforms: [iOS 27.1+, iPadOS 27.1+]
path: "uikit/uihingeinteraction/init(updatehandler:)"
---

# init(updateHandler:)

Creates a new hinge interaction with the provided update handler.

## Declaration

```swift
init(updateHandler: @escaping (UIHingeInteraction, UIHingeInteraction.Update) -> Void)
```

## Parameters

- `updateHandler`: Called with the initial hinge state and on each subsequent update for the interaction.

## Discussion

Discussion The handler is invoked with the initial hinge state, and again whenever there is an update. An update can occur due to the hinge changing, or when the interaction moves between hierarchies. The handler is stored and escapes, so take care to avoid retain cycles.
