Enumeration

UIDeviceOrientation

The physical orientation of the device.

Declaration

typedef enum UIDeviceOrientation : NSInteger {
    ...
} UIDeviceOrientation;

Overview

The orientation property uses these constants to identify the device orientation. These constants identify the physical orientation of the device and are not tied to the orientation of your application’s user interface.

Topics

Constants

UIDeviceOrientationUnknown

The orientation of the device cannot be determined.

UIDeviceOrientationPortrait

The device is in portrait mode, with the device held upright and the home button at the bottom.

UIDeviceOrientationPortraitUpsideDown

The device is in portrait mode but upside down, with the device held upright and the home button at the top.

UIDeviceOrientationLandscapeLeft

The device is in landscape mode, with the device held upright and the home button on the right side.

UIDeviceOrientationLandscapeRight

The device is in landscape mode, with the device held upright and the home button on the left side.

UIDeviceOrientationFaceUp

The device is held parallel to the ground with the screen facing upwards.

UIDeviceOrientationFaceDown

The device is held parallel to the ground with the screen facing downwards.

Testing the Orientation

UIDeviceOrientationIsFlat

Returns a Boolean value indicating whether the specified orientation is face up or face down.

UIDeviceOrientationIsLandscape

Returns a Boolean value indicating whether the device is in a landscape orientation.

UIDeviceOrientationIsPortrait

Returns a Boolean value indicating whether the device is in a portrait orientation.

UIDeviceOrientationIsValidInterfaceOrientation

Returns a Boolean value indicating whether the specified orientation is one of the portrait or landscape orientations.

See Also

Tracking the Device Orientation

orientation

Returns the physical orientation of the device.

generatesDeviceOrientationNotifications

A Boolean value that indicates whether the receiver generates orientation notifications (YES) or not (NO).

- beginGeneratingDeviceOrientationNotifications

Begins the generation of notifications of device orientation changes.

- endGeneratingDeviceOrientationNotifications

Ends the generation of notifications of device orientation changes.