---
title: "collectionView(_:acceptDrop:index:dropOperation:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionviewdelegate/collectionview(_:acceptdrop:index:dropoperation:)"
---

# collectionView(_:acceptDrop:index:dropOperation:)

Invoked when the mouse is released over a collection view that previously allowed a drop.

## Declaration

```swift
@MainActor optional func collectionView(_ collectionView: NSCollectionView, acceptDrop draggingInfo: any NSDraggingInfo, index: Int, dropOperation: NSCollectionView.DropOperation) -> Bool
```

## Parameters

- `collectionView`: The collection view that send the message.
- `draggingInfo`: An object that contains more information about this dragging operation.
- `index`: The index of the proposed drop item.
- `dropOperation`: The type of dragging operation.

## Return Value

Return Value true if the drop operation should be accepted, otherwise false.

## Discussion

Discussion This method is called when the mouse is released over a collection view that previously decided to allow a drop via the collectionView(_:validateDrop:proposedIndex:dropOperation:) method. At this time, the delegate should incorporate the data from the dragging pasteboard and update the collection view’s contents. You must implement this method for your collection view to be a drag destination

## See Also

### Legacy Collection View Support

- [collectionView(_:canDragItemsAt:with:)](appkit/nscollectionviewdelegate/collectionview(_:candragitemsat:with:)-39rjh.md)
- [collectionView(_:pasteboardWriterForItemAt:)](appkit/nscollectionviewdelegate/collectionview(_:pasteboardwriterforitemat:)-7ldvs.md)
- [collectionView(_:writeItemsAt:to:)](appkit/nscollectionviewdelegate/collectionview(_:writeitemsat:to:)-a1lk.md)
- [collectionView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAt:)](appkit/nscollectionviewdelegate/collectionview(_:namesofpromisedfilesdroppedatdestination:fordraggeditemsat:)-wwec.md)
- [collectionView(_:draggingImageForItemsAt:with:offset:)](appkit/nscollectionviewdelegate/collectionview(_:draggingimageforitemsat:with:offset:)-4yvk5.md)
- [collectionView(_:draggingSession:willBeginAt:forItemsAt:)](appkit/nscollectionviewdelegate/collectionview(_:draggingsession:willbeginat:foritemsat:)-cpuq.md)
- [collectionView(_:validateDrop:proposedIndex:dropOperation:)](appkit/nscollectionviewdelegate/collectionview(_:validatedrop:proposedindex:dropoperation:).md)
