One Logo Pool Ball
SwiftUI · IOS API REFERENCE

InterfaceOrientation

struct · iOS 15.0+ · SDK 27.1

struct InterfaceOrientation

The orientation of the interface from the user's perspective. By default, device previews appear right side up, using orientation ``InterfaceOrientation/portrait``. You can change the orientation with a call to the ``View/previewInterfaceOrientation(_:)`` modifier: struct CircleImage_Previews: PreviewProvider { static var previews: some View { CircleImage() .previewInterfaceOrientation(.landscapeRight) } }

Members (6)

get · iOS 15.0+

landscapeLeft

TypeScript
static get landscapeLeft(): InterfaceOrientation
Swift declaration
static let landscapeLeft: InterfaceOrientation

The device is in landscape mode, with the top of the device on the left.

get · iOS 15.0+

landscapeRight

TypeScript
static get landscapeRight(): InterfaceOrientation
Swift declaration
static let landscapeRight: InterfaceOrientation

The device is in landscape mode, with the top of the device on the right.

get · iOS 15.0+

portraitUpsideDown

TypeScript
static get portraitUpsideDown(): InterfaceOrientation
Swift declaration
static let portraitUpsideDown: InterfaceOrientation

The device is in portrait mode, but is upside down.

get · iOS 15.0+

id

TypeScript
get id(): string
Swift declaration
var id: String { get }

The stable identity of the entity associated with this instance.

get · iOS 15.0+

allCases

TypeScript
static get allCases(): Array<InterfaceOrientation>
Swift declaration
static var allCases: [InterfaceOrientation] { get }

A collection of all values of this type.

get · iOS 15.0+

portrait

TypeScript
static get portrait(): InterfaceOrientation
Swift declaration
static let portrait: InterfaceOrientation

The device is in portrait mode, with the top of the device on top.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →