<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/shouldDelayWindowOrdering(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)shouldDelayWindowOrderingForEvent:"
  },
  "title" : "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.

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

## Parameters

`event`

An object representing an initial mouse-down event.

## Return Value

If this method returns <doc://com.apple.documentation/documentation/Swift/true>, the normal window-ordering and activation mechanism is delayed (not necessarily prevented) until the next mouse-up event. If it returns <doc://com.apple.documentation/documentation/Swift/false>, then normal ordering and activation occur.

## 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 <doc://com.apple.documentation/documentation/Swift/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:)`](/documentation/AppKit/NSResponder/mouseDown(with:)) message for `theEvent` is sent. The default implementation returns <doc://com.apple.documentation/documentation/Swift/false>.

If, after delaying window ordering, the view actually initiates a dragging session or similar operation, it should also send a [`preventWindowOrdering()`](/documentation/AppKit/NSApplication/preventWindowOrdering()) message to `NSApp`, which completely prevents the window from ordering forward and the activation from becoming active. [`preventWindowOrdering()`](/documentation/AppKit/NSApplication/preventWindowOrdering()) is sent automatically by the `dragImage:` and `dragFile:` methods of `NSView`.

## See Also

[`dragImage:at:offset:event:pasteboard:source:slideBack:`](/documentation/AppKit/NSView/dragImage:at:offset:event:pasteboard:source:slideBack:)

Initiates a dragging operation from the view, allowing the user to drag arbitrary data with a specified icon into any application that has window or view objects that accept dragged data.



---

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)