The orientation of the app's user interface.
Starting in iOS 8, you should employ the
UITraitEnvironment APIs, and size class properties as used in those APIs, instead of using
UIInterfaceOrientation constants or otherwise writing your app in terms of interface orientation.
In earlier versions of iOS, you used these constants in the
statusBarOrientation property and the
setStatusBarOrientation(_:animated:) method. Notice that
UIDeviceOrientationLandscapeRightis assigned to
UIDeviceOrientationLandscapeLeft is assigned to
UIInterfaceOrientationLandscapeRight; the reason for this is that rotating the device requires rotating the content in the opposite direction.
The orientation of the device cannot be determined.
The device is in portrait mode, with the device held upright and the home button on the bottom.
The device is in portrait mode but upside down, with the device held upright and the home button at the top.
The device is in landscape mode, with the device held upright and the Home button on the right side.
The device is in landscape mode, with the device held upright and the Home button on the left side.
var isLandscape: Bool
A Boolean value indicating whether the user interface is currently presented in a landscape orientation.
var isPortrait: Bool
A Boolean value indicating whether the user interface is currently presented in a portrait orientation.
Managing Interface Geometry