Enumeration

UIInterfaceOrientationMask

These constants are mask bits for specifying a view controller’s supported interface orientations.

Declaration

typedef enum UIInterfaceOrientationMask : NSUInteger {
    ...
} UIInterfaceOrientationMask;

Overview

Starting in iOS 8, you should employ the UITraitCollection and 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 returned these constants from the supportedInterfaceOrientationsForWindow: method or when determining which orientations to support in your app’s view controllers.

Topics

Constants

UIInterfaceOrientationMaskPortrait

The view controller supports a portrait interface orientation.

UIInterfaceOrientationMaskLandscapeLeft

The view controller supports a landscape-left interface orientation.

UIInterfaceOrientationMaskLandscapeRight

The view controller supports a landscape-right interface orientation.

UIInterfaceOrientationMaskPortraitUpsideDown

The view controller supports an upside-down portrait interface orientation.

UIInterfaceOrientationMaskLandscape

The view controller supports both landscape-left and landscape-right interface orientation.

UIInterfaceOrientationMaskAll

The view controller supports all interface orientations.

UIInterfaceOrientationMaskAllButUpsideDown

The view controller supports all but the upside-down portrait interface orientation.

See Also

Managing Interface Geometry

- application:supportedInterfaceOrientationsForWindow:

Asks the delegate for the interface orientations to use for the view controllers in the specified window.

- application:willChangeStatusBarOrientation:duration:

Tells the delegate when the interface orientation of the status bar is about to change.

Deprecated
- application:didChangeStatusBarOrientation:

Tells the delegate when the interface orientation of the status bar has changed.

Deprecated
- application:willChangeStatusBarFrame:

Tells the delegate when the frame of the status bar is about to change.

Deprecated
- application:didChangeStatusBarFrame:

Tells the delegate when the frame of the status bar has changed.

Deprecated
UIInterfaceOrientation

The orientation of the app's user interface.

UIApplicationInvalidInterfaceOrientationException

This exception is thrown if a view controller or the app returns 0 instead of a valid set of supported interface orientation values. It is also thrown if the orientation returned by a view controller’s preferredInterfaceOrientationForPresentation method does not match one of the view controller’s supported orientations.