<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDevice/beginGeneratingDeviceOrientationNotifications()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDevice(im)beginGeneratingDeviceOrientationNotifications"
  },
  "title" : "beginGeneratingDeviceOrientationNotifications()"
}
-->

# beginGeneratingDeviceOrientationNotifications()

Begins the generation of notifications of device orientation changes.

```
func beginGeneratingDeviceOrientationNotifications()
```

## Discussion

You must call this method before attempting to get orientation data from the device. This method enables the device’s accelerometer hardware and begins the delivery of acceleration events to the device. The device subsequently uses these events to post [`orientationDidChangeNotification`](/documentation/UIKit/UIDevice/orientationDidChangeNotification) notifications when the device orientation changes and to update the [`orientation`](/documentation/UIKit/UIDevice/orientation) property.

You may nest calls to this method safely, but you should always match each call with a corresponding call to the [`endGeneratingDeviceOrientationNotifications()`](/documentation/UIKit/UIDevice/endGeneratingDeviceOrientationNotifications()) method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)