<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:acceptDrop:index:dropOperation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSCollectionViewDelegate(im)collectionView:acceptDrop:index:dropOperation:"
  },
  "title" : "collectionView(_:acceptDrop:index:dropOperation:)"
}
-->

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

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

```
@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

<doc://com.apple.documentation/documentation/Swift/true> if the drop operation should be accepted, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## 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:)`](/documentation/AppKit/NSCollectionViewDelegate/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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)