Contents

outlineView(_:draggingSession:willBeginAt:forItems:)

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

Declaration

@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:) 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:). Hence, the order is deterministic, and can be used in outlineView(_:acceptDrop:item:childIndex:) when enumerating the NSDraggingInfo protocol’s pasteboard classes.

See Also

Instance Methods