Contents

outlineView(_:validateDrop:proposedItem:proposedChildIndex:)

Used by an outline view to determine a valid drop target.

Declaration

@MainActor optional func outlineView(_ outlineView: NSOutlineView, validateDrop info: any NSDraggingInfo, proposedItem item: Any?, proposedChildIndex index: Int) -> NSDragOperation

Parameters

  • outlineView:

    The outline view that sent the message.

  • info:

    An object that contains more information about this dragging operation.

  • item:

    The proposed parent.

  • index:

    The proposed child location.

Return Value

A value that indicates which dragging operation the data source will perform.

Discussion

Based on the mouse position, the outline view will suggest a proposed drop location. The data source may “retarget” a drop if desired by calling setDropItem(_:dropChildIndex:) and returning something other than NSDragOperationNone. You may choose to retarget for various reasons (for example, for better visual feedback when inserting into a sorted position).

Implementation of this method is optional.

See Also

Instance Methods