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

# prefersPointerLocked

A Boolean value that indicates whether the view controller prefers to lock the pointer to a specific scene.

```
var prefersPointerLocked: Bool { get }
```

## Discussion

The default is <doc://com.apple.documentation/documentation/Swift/false>. Setting this property to <doc://com.apple.documentation/documentation/Swift/true> indicates the view controller’s preference to lock the pointer, although the system may not honor the request. Use [`isLocked`](/documentation/UIKit/UIPointerLockState/isLocked) to determine the current pointer lock state. For the system to consider locking the pointer:

- The scene must be full screen, not in Split View or Slide Over, with no other apps in Slide Over.
- The scene must be in the [`UIScene.ActivationState.foregroundActive`](/documentation/UIKit/UIScene/ActivationState-swift.enum/foregroundActive) state.
- For an app built with Mac Catalyst, the app must be in the foreground, and the window that contains the scene ordered to the front.

> Note:
> Bringing an app built with Mac Catalyst to the foreground doesn’t immediately enable pointer lock. To enable pointer lock, the user must click in the window. To exit pointer lock, users can use Command-tab to switch to another app, or using Command-tilde.

The system continuously monitors the state and when the app no longer satisfies the requirements, it disables the pointer lock. When the lock state changes, the system posts [`didChangeNotification`](/documentation/UIKit/UIPointerLockState/didChangeNotification).

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

---

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)