---
title: "dragOperation(for:type:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextview/dragoperation(for:type:)"
---

# dragOperation(for:type:)

Returns the type of drag operation that should be performed if the image were released now.

## Declaration

```swift
func dragOperation(for dragInfo: any NSDraggingInfo, type: NSPasteboard.PasteboardType) -> NSDragOperation
```

## Parameters

- `dragInfo`: The drag information.
- `type`: The pasteboard type that will be read from the dragging pasteboard.

## Return Value

Return Value The drag operation that should be performed if the image were released now.

## Discussion

Discussion The returned value should be one of the following:  |   |   |   |   |  If none of the operations is appropriate, this method should return NSDragOperationNone. This method is called repeatedly from draggingEntered(_:) and draggingUpdated(_:) as the user drags the image.

## See Also

### Related Documentation

- [draggingUpdated(_:)](appkit/nsdraggingdestination/draggingupdated(_:).md)
- [draggingEntered(_:)](appkit/nsdraggingdestination/draggingentered(_:).md)

### Dragging

- [dragImageForSelection(with:origin:)](appkit/nstextview/dragimageforselection(with:origin:).md)
- [dragSelection(with:offset:slideBack:)](appkit/nstextview/dragselection(with:offset:slideback:).md)
- [acceptsGlyphInfo](appkit/nstextview/acceptsglyphinfo.md)
