<!--
{
  "availability" : [
    "iOS: 27.1.0 -",
    "iPadOS: 27.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIHingeInteraction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIHingeInteraction"
  },
  "title" : "UIHingeInteraction"
}
-->

# UIHingeInteraction

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

```
@MainActor class UIHingeInteraction
```

## 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: (UIHingeInteraction, UIHingeInteraction.Update) -> Void)`](/documentation/UIKit/UIHingeInteraction/init(updateHandler:))

Creates a new hinge interaction with the provided update handler.

### Configuring the interaction

[`var isEnabled: Bool`](/documentation/UIKit/UIHingeInteraction/isEnabled)

Whether the interaction is enabled.

### Getting hinge updates

[`class Update`](/documentation/UIKit/UIHingeInteraction/Update)

An update for a `UIHingeInteraction`

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`UIInteraction`](/documentation/UIKit/UIInteraction)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)