<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewDropDelegate/collectionView(_:canHandle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UICollectionViewDropDelegate(im)collectionView:canHandleDropSession:"
  },
  "title" : "collectionView(_:canHandle:)"
}
-->

# collectionView(_:canHandle:)

Asks your delegate whether the collection view can accept a drop with the specified type of data.

```
optional func collectionView(_ collectionView: UICollectionView, canHandle session: any UIDropSession) -> Bool
```

## Parameters

`collectionView`

The collection view that’s attempting to handle the drop.

`session`

The drop session object containing information about the type of data being dragged.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the collection view can accept the dragged data or <doc://com.apple.documentation/documentation/Swift/false> if it cannot.

## Discussion

Implement this method when you want to dynamically determine whether to accept dropped data in your collection view. In your implementation, check the type of the dragged data and return a Boolean value indicating whether you can accept the drop. For example, you might call the [`hasItemsConforming(toTypeIdentifiers:)`](/documentation/UIKit/UIDragDropSession/hasItemsConforming(toTypeIdentifiers:)) method of the session object to determine whether it contains data that your app can accept.

If you don’t implement this method, the collection view assumes a return value of <doc://com.apple.documentation/documentation/Swift/true>. If you return <doc://com.apple.documentation/documentation/Swift/false> from this method, the collection view doesn’t call any more methods of your drop delegate for the given session.

---

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)