Interactive previews iPhone Duo
Hinge State
A type encapsulating the state of a single hinge.
Platform Compatibility
iOS 27.1+ iPadOS 27.1+
Tags
SwiftUI Code
@State private var hinge: DeviceHinge? = nil
var body: some View {
VStack {
if let hinge {
Text("Status \(hinge.status)")
Text("Angle \(hinge.angle.degrees, specifier: "%.0f")°")
} else {
ContentUnavailableView(
"Hinge Unavailable",
systemImage: "rectangle.split.2x1"
)
}
}
.onHingeChange { _, newContext in
hinge = newContext.hinge
}
}Found an issue or have a suggestion?
Created: September 26, 2026Updated: October 27, 2026
More View Components
View allToolbar Vertical Edge
This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.
Music Picker
Presents a music picker to select items from the Apple Music catalog and the user’s music library.
Explore Other Components
Browse allSheet Background
Sets the presentation background of the enclosing sheet using a shape style.
LinearCapacityGaugeStyle
A gauge style that displays a bar that fills from leading to trailing edges as the gauge’s current value increases
Current Value Gauge
Creates a gauge showing a value within a range and that describes the gauge’s purpose and current value