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
outlineView(_:acceptDrop:item:childIndex:)outlineView(_:child:ofItem:)outlineView(_:draggingSession:endedAt:operation:)outlineView(_:isItemExpandable:)outlineView(_:itemForPersistentObject:)outlineView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)outlineView(_:numberOfChildrenOfItem:)outlineView(_:objectValueFor:byItem:)outlineView(_:pasteboardWriterForItem:)outlineView(_:persistentObjectForItem:)outlineView(_:setObjectValue:for:byItem:)outlineView(_:sortDescriptorsDidChange:)outlineView(_:updateDraggingItemsForDrag:)outlineView(_:validateDrop:proposedItem:proposedChildIndex:)outlineView(_:writeItems:to:)