<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:draggingSession:willBeginAt:forItems:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSOutlineViewDataSource(im)outlineView:draggingSession:willBeginAtPoint:forItems:"
  },
  "title" : "outlineView(_:draggingSession:willBeginAt:forItems:)"
}
-->

# outlineView(_:draggingSession:willBeginAt:forItems:)

Implement this method know when the given dragging session is about to begin and potentially modify the dragging session.

```
@MainActor optional func outlineView(_ outlineView: NSOutlineView, draggingSession session: NSDraggingSession, willBeginAt screenPoint: NSPoint, forItems draggedItems: [Any])
```

## Parameters

`outlineView`

The outline view in which the drag is about to begin.

`session`

The dragging session that is about to begin.

`screenPoint`

The point onscreen at which the drag is to begin.

`draggedItems`

A array of items to be dragged, excluding items for which [`outlineView(_:pasteboardWriterForItem:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:pasteboardWriterForItem:)) returns `nil`.

## Discussion

The `draggedItems` array directly matches the pasteboard writer array used to begin the dragging session with the `NSView` method [`beginDraggingSession(with:event:source:)`](/documentation/AppKit/NSView/beginDraggingSession(with:event:source:)). Hence, the order is deterministic, and can be used in [`outlineView(_:acceptDrop:item:childIndex:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:acceptDrop:item:childIndex:)) when enumerating the `NSDraggingInfo` protocol’s pasteboard classes.

---

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)