Instance Property

supportedInterfaceOrientations

Returns all of the interface orientations that the view controller supports.

Declaration

@property(nonatomic, readonly) UIInterfaceOrientationMask supportedInterfaceOrientations;

Return Value

A bit mask specifying which orientations are supported. See UIInterfaceOrientationMask for valid bit-mask values. The value returned by this method must not be 0.

Discussion

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 are rotated to the new orientation. This method is only called if the view controller'€™s shouldAutorotate method returns YES.

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 is set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom.

The system intersects 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:supportedInterfaceOrientationsForWindow: method) and the device's supported orientations to determine whether to rotate. For example, the UIInterfaceOrientationPortraitUpsideDown orientation is not supported on iPhone X.

See Also

Configuring the View Rotation Settings

shouldAutorotate

Returns a Boolean value indicating whether the view controller'€™s contents should auto rotate.

preferredInterfaceOrientationForPresentation

Returns the interface orientation to use when presenting the view controller.

+ attemptRotationToDeviceOrientation

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software