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

# performDragOperation(_:)

Invoked after the released image has been removed from the screen, signaling the receiver to import the pasteboard data.

```
@MainActor optional func performDragOperation(_ sender: any NSDraggingInfo) -> Bool
```

## Parameters

`sender`

The object sending the message; use it to get details about the dragging operation.

## Return Value

If the destination accepts the data, it returns <doc://com.apple.documentation/documentation/Swift/true>; otherwise it returns <doc://com.apple.documentation/documentation/Swift/false>. The default is to return <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

For this method to be invoked, the previous [`prepareForDragOperation(_:)`](/documentation/AppKit/NSDraggingDestination/prepareForDragOperation(_:)) message must have returned <doc://com.apple.documentation/documentation/Swift/true>. The destination should implement this method to do the real work of importing the pasteboard data represented by the image.

If the sender object’s [`animatesToDestination`](/documentation/AppKit/NSDraggingInfo/animatesToDestination) was set to <doc://com.apple.documentation/documentation/Swift/true> in [`prepareForDragOperation(_:)`](/documentation/AppKit/NSDraggingDestination/prepareForDragOperation(_:)), then setup any animation to arrange space for the drag items to animate to. Also at this time, enumerate through the dragging items to set their destination frames and destination images.

---

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)