---
title: orientation
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uidevice/orientation
---

# orientation

The physical orientation of the device.

## Declaration

```swift
var orientation: UIDeviceOrientation { get }
```

## Discussion

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 UIDeviceOrientation for descriptions of the possible values. The value of this property always returns 0 unless orientation notifications have been enabled by calling beginGeneratingDeviceOrientationNotifications().

## See Also

### Tracking the device orientation

- [UIDeviceOrientation](uikit/uideviceorientation.md)
- [isGeneratingDeviceOrientationNotifications](uikit/uidevice/isgeneratingdeviceorientationnotifications.md)
- [beginGeneratingDeviceOrientationNotifications()](uikit/uidevice/begingeneratingdeviceorientationnotifications().md)
- [endGeneratingDeviceOrientationNotifications()](uikit/uidevice/endgeneratingdeviceorientationnotifications().md)
