---
title: "shouldDelayWindowOrdering(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsview/shoulddelaywindowordering(for:)"
---

# shouldDelayWindowOrdering(for:)

Allows the user to drag objects from the view without activating the app or moving the window of the view forward, possibly obscuring the destination.

## Declaration

```swift
func shouldDelayWindowOrdering(for event: NSEvent) -> Bool
```

## Parameters

- `event`: An object representing an initial mouse-down event.

## Return Value

Return Value If this method returns true, the normal window-ordering and activation mechanism is delayed (not necessarily prevented) until the next mouse-up event. If it returns false, then normal ordering and activation occur.

## Discussion

Discussion Never invoke this method directly; it’s invoked automatically for each mouse-down event directed at the NSView. An NSView subclass that allows dragging should implement this method to return true if theEvent is potentially the beginning of a dragging session or of some other context where window ordering isn’t appropriate. This method is invoked before a mouseDown(with:) message for theEvent is sent. The default implementation returns false. If, after delaying window ordering, the view actually initiates a dragging session or similar operation, it should also send a preventWindowOrdering() message to NSApp, which completely prevents the window from ordering forward and the activation from becoming active. preventWindowOrdering() is sent automatically by the dragImage: and dragFile: methods of NSView.

## See Also

### Dragging Operations

- [registerForDraggedTypes(_:)](appkit/nsview/registerfordraggedtypes(_:).md)
- [unregisterDraggedTypes()](appkit/nsview/unregisterdraggedtypes().md)
- [registeredDraggedTypes](appkit/nsview/registereddraggedtypes.md)
- [beginDraggingSession(with:event:source:)](appkit/nsview/begindraggingsession(with:event:source:).md)
- [beginDraggingSession(items:gesture:source:)](appkit/nsview/begindraggingsession(items:gesture:source:).md)
