<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:canDragItemsAt:with:)-49wix",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSCollectionViewDelegate(im)collectionView:canDragItemsAtIndexPaths:withEvent:"
  },
  "title" : "collectionView(_:canDragItemsAt:with:)"
}
-->

# collectionView(_:canDragItemsAt:with:)

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

```
@MainActor optional func collectionView(_ collectionView: NSCollectionView, canDragItemsAt indexPaths: Set<IndexPath>, with event: NSEvent) -> Bool
```

## Parameters

`collectionView`

The collection view making the request.

`indexPaths`

The index paths of the items about to be dragged.

`event`

The mouse-down event that began the drag operation.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the drag operation can begin or <doc://com.apple.documentation/documentation/Swift/false> if it cannot.

## Discussion

If you do not implement this method and your collection view has only one section, the collection view calls the legacy [`collectionView(_:canDragItemsAt:with:)`](/documentation/AppKit/NSCollectionViewDelegate/collectionView(_:canDragItemsAt:with:)-39rjh) method. If you do not implement either method, the collection view assumes a return value of <doc://com.apple.documentation/documentation/Swift/true>.

---

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)