angle
TypeScriptget angle(): AngleSwift declarationvar angle: AngleCurrent angle of the hinge.
struct · iOS 27.1+ · SDK 27.1
struct DeviceHingeA 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.
get angle(): AngleSwift declarationvar angle: AngleCurrent angle of the hinge.
set angle(value: Angle)Swift declarationvar angle: AngleCurrent angle of the hinge.
get status(): DeviceHinge_StatusSwift declarationvar status: DeviceHinge.StatusCurrent status of the hinge.
set status(value: DeviceHinge_Status)Swift declarationvar status: DeviceHinge.StatusCurrent status of the hinge.
No declarations were skipped in this snapshot.