Instance Method

collectionView(_:draggingSession:willBeginAt:forItemsAt:)

Notifies your delegate that a drag session is about to begin.

Declaration

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

func collectionView(NSCollectionView, canDragItemsAt: Set<IndexPath>, with: NSEvent) -> Bool

Returns a Boolean indicating whether a drag operation involving the specified items can begin.

func collectionView(NSCollectionView, pasteboardWriterForItemAt: IndexPath) -> NSPasteboardWriting?

Provides the pasteboard writer for the item at the specified index path.

func collectionView(NSCollectionView, writeItemsAt: Set<IndexPath>, to: NSPasteboard) -> Bool

Places the data for the drag operation on the pasteboard.

Deprecated
func collectionView(NSCollectionView, namesOfPromisedFilesDroppedAtDestination: URL, forDraggedItemsAt: Set<IndexPath>) -> [String]

Returns the names of the promised files that you created for a drag operation.

Deprecated
func collectionView(NSCollectionView, updateDraggingItemsForDrag: NSDraggingInfo)

Asks your delegate to update the dragging items during a drag operation.