collectionView(_:draggingSession:willBeginAt:forItemsAt:)
Notifies your delegate that a drag session is about to begin.
Declaration
@MainActor optional func collectionView(_ collectionView: NSCollectionView, draggingSession session: NSDraggingSession, willBeginAt screenPoint: NSPoint, forItemsAt indexPaths: Set<IndexPath>)Parameters
- collectionView:
The collection view notifying your delegate object.
- session:
The dragging session that is about to begin.
- screenPoint:
The starting point (in screen coordinates) for the drag operation.
- indexPaths:
The index paths of the items being dragged.
Discussion
You can use this method to modify the dragging session or to perform other tasks related to the beginning of a drag session.
See Also
Drag and Drop Support
Supporting Collection View Drag and Drop Through File PromisescollectionView(_:canDragItemsAt:with:)collectionView(_:pasteboardWriterForItemAt:)collectionView(_:writeItemsAt:to:)collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)collectionView(_:draggingImageForItemsAt:with:offset:)collectionView(_:draggingSession:endedAt:dragOperation:)collectionView(_:updateDraggingItemsForDrag:)collectionView(_:validateDrop:proposedIndexPath:dropOperation:)collectionView(_:acceptDrop:indexPath:dropOperation:)