---
title: "textView(_:writablePasteboardTypesFor:at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextviewdelegate/textview(_:writablepasteboardtypesfor:at:)"
---

# textView(_:writablePasteboardTypesFor:at:)

Returns the writable pasteboard types for a given cell.

## Declaration

```swift
@MainActor optional func textView(_ view: NSTextView, writablePasteboardTypesFor cell: any NSTextAttachmentCellProtocol, at charIndex: Int) -> [NSPasteboard.PasteboardType]
```

## Parameters

- `view`: The text view sending the message.
- `cell`: The cell in question.
- `charIndex`: The character index in the text view that was clicked.

## Return Value

Return Value An array of types that can be written to the pasteboard for cell.

## Discussion

Discussion This method is invoked after the user clicks cell at the specified charIndex location in aTextView. If the textView(_:draggedCell:in:event:at:) is not used, this method and textView(_:write:at:to:type:) allow aTextView to take care of attachment dragging and pasting, with the delegate responsible only for writing the attachment to the pasteboard.

## See Also

### Managing the Pasteboard

- [textView(_:write:at:to:type:)](appkit/nstextviewdelegate/textview(_:write:at:to:type:).md)
