Returns the physical orientation of the device.
SDKs
- iOS 2.0+
- Mac Catalyst 13.0+
Framework
- UIKit
Declaration
var orientation: UIDevice Orientation { get }
Discussion
The value of the property is a constant that indicates the current orientation of the device. This value represents the physical orientation of the device and may be different from the current orientation of your application’s user interface. See UIDevice
for descriptions of the possible values.
The value of this property always returns 0 unless orientation notifications have been enabled by calling begin
.