<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.13.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDrawerDelegate/drawerShouldOpen(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSDrawerDelegate(im)drawerShouldOpen:"
  },
  "title" : "drawerShouldOpen(_:)"
}
-->

# drawerShouldOpen(_:)

Asks the delegate if the specified drawer should open.

```
optional func drawerShouldOpen(_ sender: NSDrawer) -> Bool
```

## Parameters

`sender`

The drawer requesting permission to open.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the drawer should open; <doc://com.apple.documentation/documentation/Swift/false> to prevent the drawer from opening.

## Discussion

This method is invoked on user-initiated attempts to open a drawer by dragging it or when the [`NSDrawerDelegate`](/documentation/AppKit/NSDrawerDelegate) method is called.

## See Also

  [Drawer Programming Topics](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Drawers/Drawers.html#//apple_ref/doc/uid/10000001i)



---

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)