One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

DeviceHinge

struct · iOS 27.1+ · SDK 27.1

struct DeviceHinge

A type encapsulating the state of a single hinge. A hinge provides its angle along with a status determined by the system based on the current angle and device orientation. You use this type with the ``View/onHingeChange(_:)`` modifier. @State private var hinge: DeviceHinge? = nil var body: some View { VStack { if let hinge { AngleDisplayView(angle: hinge.angle) StatusDisplayView(status: hinge.status) } else { ContentUnavailableView( "Hinge Unavailable", systemImage: "rectangle.split.2x1") } } .onHingeChange { _, newContext in hinge = newContext.hinge } } In the example above, the current angle and status of the hinge will be displayed in the app as you interact with the hinge.

Members (4)

get · iOS 27.1+

angle

TypeScript
get angle(): Angle
Swift declaration
var angle: Angle

Current angle of the hinge.

set · iOS 27.1+

angle

TypeScript
set angle(value: Angle)
Swift declaration
var angle: Angle

Current angle of the hinge.

get · iOS 27.1+

status

TypeScript
get status(): DeviceHinge_Status
Swift declaration
var status: DeviceHinge.Status

Current status of the hinge.

set · iOS 27.1+

status

TypeScript
set status(value: DeviceHinge_Status)
Swift declaration
var status: DeviceHinge.Status

Current status of the hinge.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →