<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableView/dragImageForRows:event:dragImageOffset:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableView(im)dragImageForRows:event:dragImageOffset:"
  },
  "title" : "dragImageForRows:event:dragImageOffset:"
}
-->

# dragImageForRows:event:dragImageOffset:

Computes and returns an image to use for dragging.

```
- (NSImage *) dragImageForRows:(NSArray *) dragRows event:(NSEvent *) dragEvent dragImageOffset:(NSPointPointer) dragImageOffset;
```

## Discussion

Override this to return a custom image. `dragRows` represents the rows participating in the drag. `dragEvent` is a reference to the mouse-down event that began the drag. `dragImageOffset` is an in/out parameter.

This method is called with `dragImageOffset` set to `NSZeroPoint`, but it can be modified to reposition the returned image. A `dragImageOffset` of `NSZeroPoint` will cause the image to be centered under the cursor.

> Note:
> To support multi-item drags, it is highly recommended to implement the delegate method ``doc://com.apple.appkit/documentation/AppKit/NSTableViewDataSource/tableView(_:pasteboardWriterForRow:)`` instead. Using that method will cause this method to not be called.

---

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)