---
title: "draw(withFrame:in:characterIndex:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextattachmentcellprotocol/draw(withframe:in:characterindex:)"
---

# draw(withFrame:in:characterIndex:)

Draws the cell’s image at the specified index point in the view.

## Declaration

```swift
@MainActor func draw(withFrame cellFrame: NSRect, in controlView: NSView?, characterIndex charIndex: Int)
```

## Parameters

- `cellFrame`: The frame rectangle in which to draw.
- `controlView`: The view in which to draw.
- `charIndex`: The index of the attachment character within the text.

## See Also

### Drawing the cell contents

- [draw(withFrame:in:)](appkit/nstextattachmentcellprotocol/draw(withframe:in:).md)
- [draw(withFrame:in:characterIndex:layoutManager:)](appkit/nstextattachmentcellprotocol/draw(withframe:in:characterindex:layoutmanager:).md)
- [highlight(_:withFrame:in:)](appkit/nstextattachmentcellprotocol/highlight(_:withframe:in:).md)
