Contents

collectionView(_:updateDraggingItemsForDrag:)

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

Declaration

@MainActor optional func collectionView(_ collectionView: NSCollectionView, updateDraggingItemsForDrag draggingInfo: any NSDraggingInfo)

Parameters

  • collectionView:

    The collection view asking you to update the dragging items.

  • draggingInfo:

    The current information for the drag operation. Use this object to iterate over the dragging items.

Discussion

You can use this method to update the current drag items while a drag is in progress. Updating the drag items is optional, but you might use this method to change the image for an item. For example, you might change the image when the mouse hovers over a particular part of the collection view. Use the enumerateDraggingItems(options:for:classes:searchOptions:using:) method of the draggingInfo parameter to iterate over the drag items and update them as appropriate.

See Also

Drag and Drop Support