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

# collectionView(_:validateDrop:proposedIndex:dropOperation:)

Validates the specified location to see if it is a valid drop target.

```
@MainActor optional func collectionView(_ collectionView: NSCollectionView, validateDrop draggingInfo: any NSDraggingInfo, proposedIndex proposedDropIndex: UnsafeMutablePointer<Int>, dropOperation proposedDropOperation: UnsafeMutablePointer<NSCollectionView.DropOperation>) -> NSDragOperation
```

## Parameters

`collectionView`

The collection view that send the message.

`draggingInfo`

An object containing details about this dragging operation.

`proposedDropIndex`

The proposed drop index. This parameter is passed by-reference and can be modified retarget the drop operation.

`proposedDropOperation`

The proposed drop operation. This parameter is passed by-reference and can be modified to change the drop operation.

## Return Value

A value that indicates which dragging operation to perform. Return [`NSDragOperationNone`](/documentation/AppKit/NSDragOperation/NSDragOperationNone) to disallow the drop.

## Discussion

Based on the mouse position, the collection view will suggest a proposed index and drop operation. These values are in/out parameters and can be changed by the delegate to retarget the drop operation.

The collection view will propose `NSCollectionViewDropOn` when the dragging location is closer to the middle of the item than either of its edges. Otherwise, it will propose `NSCollectionViewDropBefore`. You may override this default behavior by changing `proposedDropOperation` or `proposedDropIndex`.

To receive drag messages, you must first send [`registerForDraggedTypes(_:)`](/documentation/AppKit/NSView/registerForDraggedTypes(_:)) to the collection view with the drag types you want to support.

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)