Instance Property

preferredInterfaceOrientationForPresentation

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

Declaration

var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation { get }

Return Value

The interface orientation with which to present the view controller.

Discussion

The system calls this method when presenting the view controller full screen. When your view controller supports two or more orientations but the content appears best in one of those orientations, override this method and return the preferred orientation.

If your view controller implements this method, your view controller’s view is shown in the preferred orientation (although it can later be rotated to another supported rotation). If you do not implement this method, the system presents the view controller using the current orientation of the status bar.

See Also

Configuring the View Rotation Settings

var shouldAutorotate: Bool

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

var supportedInterfaceOrientations: UIInterfaceOrientationMask

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

class func attemptRotationToDeviceOrientation()

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