---
title: "drawerShouldOpen(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdrawerdelegate/drawershouldopen(_:)"
---

# drawerShouldOpen(_:)

Asks the delegate if the specified drawer should open.

## Declaration

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

## Parameters

- `sender`: The drawer requesting permission to open.

## Return Value

Return Value true if the drawer should open; false to prevent the drawer from opening.

## Discussion

Discussion This method is invoked on user-initiated attempts to open a drawer by dragging it or when the NSDrawerDelegate method is called.

## See Also

### Related Documentation

- [Drawer Programming Topics](apple-archive/documentation/Cocoa/Conceptual/Drawers.md)

### Opening and Closing Drawers

- [drawerWillOpen(_:)](appkit/nsdrawerdelegate/drawerwillopen(_:).md)
- [drawerDidOpen(_:)](appkit/nsdrawerdelegate/drawerdidopen(_:).md)
- [drawerShouldClose(_:)](appkit/nsdrawerdelegate/drawershouldclose(_:).md)
- [drawerWillClose(_:)](appkit/nsdrawerdelegate/drawerwillclose(_:).md)
- [drawerDidClose(_:)](appkit/nsdrawerdelegate/drawerdidclose(_:).md)
