---
title: "textView(_:draggedCell:in:event:at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextviewdelegate/textview(_:draggedcell:in:event:at:)"
---

# textView(_:draggedCell:in:event:at:)

Sent when the user attempts to drag a cell.

## Declaration

```swift
@MainActor optional func textView(_ view: NSTextView, draggedCell cell: any NSTextAttachmentCellProtocol, in rect: NSRect, event: NSEvent, at charIndex: Int)
```

## Parameters

- `view`: The text view sending the message.
- `cell`: The cell being dragged.
- `rect`: The rectangle from which the cell was dragged.
- `event`: The mouse-down event that preceded the mouse-dragged event.
- `charIndex`: The character position where the mouse button was clicked.

## Discussion

Discussion The delegate can use this message as its cue to initiate a dragging operation.

## See Also

### Related Documentation

- [dragFile(_:from:slideBack:event:)](appkit/nsview/dragfile(_:from:slideback:event:).md)
