---
title: UIHingeInteraction
framework: UIKit
role: symbol
role_heading: Class
platforms: [iOS 27.1+, iPadOS 27.1+]
path: uikit/uihingeinteraction
---

# UIHingeInteraction

An interaction for observing the hinge state associated with the view’s hierarchy.

## Declaration

```swift
@MainActor class UIHingeInteraction
```

## Overview

Overview Add a UIHingeInteraction to a view to receive hinge state updates. The interaction’s handler is called when the hinge state changes, or when the interaction moves between hierarchies. When the interaction moves out of a hierarchy that provides hinge updates, the update’s hinge is nil. override func viewDidLoad() {     super.viewDidLoad()

let interaction = UIHingeInteraction { [weak self] _, update in         guard let self else { return }         // A nil `hinge` indicates the interaction has left a         // hierarchy that provides hinge updates.         guard let hinge = update.hinge else {             handleHingeUnavailable()             return         }

updateAngleDisplay(with: hinge.angle)         updateStatusDisplay(with: hinge.status)     }

view.addInteraction(interaction) } In the example above, the current angle and status of the hinge are displayed as the user interacts with the hinge.

## Topics

### Creating a hinge interaction

- [init(updateHandler:)](uikit/uihingeinteraction/init(updatehandler:).md)

### Configuring the interaction

- [isEnabled](uikit/uihingeinteraction/isenabled.md)

### Getting hinge updates

- [UIHingeInteraction.Update](uikit/uihingeinteraction/update.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [UIInteraction](uikit/uiinteraction.md)

## See Also

### Device environment

- [UIDevice](uikit/uidevice.md)
- [UIStatusBarManager](uikit/uistatusbarmanager.md)
- [UIHinge](uikit/uihinge.md)
