Instance Property


The interface orientations that the view controller supports.


var supportedInterfaceOrientations: UIInterfaceOrientationMask { get }

Return Value

A bit mask specifying the supported orientations. See UIInterfaceOrientationMask for valid bit-mask values. The value that returns from this method must not be 0.


When the user changes the device orientation, the system calls this method on the root view controller or the topmost presented view controller that fills the window. If the view controller supports the new orientation, the window and view controller rotate accordingly. The system only calls this method if the view controller'€™s shouldAutorotate method returns true.

Override this method to report all of the orientations that the view controller supports. The default values for a view controller'€™s supported interface orientations are all for the iPad idiom and allButUpsideDown for the iPhone idiom.

To determine whether to rotate, the system compares the view controller'€™s supported orientations with the app's supported orientations (as determined by the Info.plist file or the app delegate's application(_:supportedInterfaceOrientationsFor:) method) and the device's supported orientations. For example, the UIViewController class doesn’t support UIInterfaceOrientation.portraitUpsideDown orientation on devices without a Home button, such as iPhone X.

If your app supports multitasking, the system doesn’t call this method on your view controller because multitasking apps must support all orientations. You can opt out of multitasking by enabling Requires full screen on your iOS target or by not declaring support for all possible orientations within the Info.plist file.

See Also

Configuring the View Rotation Settings

var shouldAutorotate: Bool

A Boolean value that indicates whether the view controller'€™s contents should autorotate.

var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation

The interface orientation to use when presenting the view controller.

class func attemptRotationToDeviceOrientation()

Attempts to rotate all windows to the orientation of the device.