<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewController/prefersInterfaceOrientationLocked",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewController(py)prefersInterfaceOrientationLocked"
  },
  "title" : "prefersInterfaceOrientationLocked"
}
-->

# prefersInterfaceOrientationLocked

A Boolean value that indicates whether the view controller prefers to lock the scene’s interface orientation when the scene is visible.

```
var prefersInterfaceOrientationLocked: Bool { get }
```

## Discussion

The default is <doc://com.apple.documentation/documentation/Swift/false>. Set this property to <doc://com.apple.documentation/documentation/Swift/true>
to indicate the view controller’s preference to lock the scene’s interface orientation. Check `UIWindowScene.effectiveGeometry.isInterfaceOrientationLocked`
for the current state of the interface orientation lock. The system will consider locking the interface orientation when these conditions are true:

- The scene is centered on the screen
- The scene is the same size as the screen
- The scene is not occluded by another scene

The system continuously monitors the state and when the app no longer satisfies the requirements, it disables the interface orientation lock.

If you change the value of `prefersInterfaceOrientationLocked`, call [`setNeedsUpdateOfPrefersInterfaceOrientationLocked()`](/documentation/UIKit/UIViewController/setNeedsUpdateOfPrefersInterfaceOrientationLocked()).

---

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)