<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PreferencePanes",
  "identifier" : "/documentation/PreferencePanes/NSPreferencePane/shouldUnselect",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Preference Panes"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPreferencePane(py)shouldUnselect"
  },
  "title" : "shouldUnselect"
}
-->

# shouldUnselect

A Boolean value that indicates whether the preference pane is able to be deselected.

```
var shouldUnselect: NSPreferencePaneUnselectReply { get }
```

## Discussion

The possible values are described in Help Menu Support. The default implementation always returns [`NSPreferencePaneUnselectReply.unselectNow`](/documentation/PreferencePanes/NSPreferencePaneUnselectReply/unselectNow). Override this method if your pane needs to cancel or delay a deselect action. If you override this method to return [`NSPreferencePaneUnselectReply.unselectLater`](/documentation/PreferencePanes/NSPreferencePaneUnselectReply/unselectLater), you must invoke [`reply(toShouldUnselect:)`](/documentation/PreferencePanes/NSPreferencePane/reply(toShouldUnselect:)) when you have determined whether or not the deselection can occur.

---

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)