<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextAttachmentCellProtocol/draw(withFrame:in:characterIndex:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextAttachmentCell(im)drawWithFrame:inView:characterIndex:"
  },
  "title" : "draw(withFrame:in:characterIndex:)"
}
-->

# draw(withFrame:in:characterIndex:)

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

```
@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.

---

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)