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

# dropInteraction(_:canHandle:)

Asks the delegate whether it can handle the session’s drag items.

```
optional func dropInteraction(_ interaction: UIDropInteraction, canHandle session: any UIDropSession) -> Bool
```

## Parameters

`interaction`

The interaction that called this method.

`session`

The current drop session.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the interaction supports the drag items in the sessions; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Returning <doc://com.apple.documentation/documentation/Swift/true> doesn’t mean the interaction will accept the drop. Instead, it tells the system that the interaction has interest in, and can handle, the drop session.

To determine if the interaction can handle the session, check the data type of session’s drag items. For instance, if you’re interested in drop activities that contain images, you can do the following:

```swift
func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool {
    // Ensure the drop session has an object of the appropriate type
    return session.canLoadObjects(ofClass: UIImage.self)
}
```

You can also be more specific by using a uniform type identifier (UTI) for the data type. For instance, if you’re interested in only PNG images, use the UTI for PNG files:

```swift
import MobileCoreServices // for kUTTypePNG

func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool {
    return session.hasItemsConforming(toTypeIdentifiers: [kUTTypePNG as String])
}
```

> Note:
> You can’t check the actual data the user is dragging because it isn’t available when the interaction calls this method. Only the data type is available inside this method.

---

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)