<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextFinderClient/drawCharacters(in:forContentView:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextFinderClient(im)drawCharactersInRange:forContentView:"
  },
  "title" : "drawCharacters(in:forContentView:)"
}
-->

# drawCharacters(in:forContentView:)

Draw the glyphs for the requested character range as they are drawn in the given content view.

```
optional func drawCharacters(in range: NSRange, forContentView view: NSView)
```

## Parameters

`range`

The character range.

`view`

The content view.

## Discussion

If the character range partially intersects a glyph range, then the full glyph is drawn to avoid additional layout.

The given range is guaranteed to be completely contained by the given view. When this method is called, a drawing context effectively identical to the one provided to the view’s [`draw(_:)`](/documentation/AppKit/NSView/draw(_:)) method is configured. This method is mainly used to draw find indicator contents, so implementations should check -the view property [`isDrawingFindIndicator`](/documentation/AppKit/NSView/isDrawingFindIndicator) to ensure that the text will be easily readable against the background of the find indicator when it returns <doc://com.apple.documentation/documentation/Swift/true>. If this method is not implemented, then the find indicator will be drawn using the content view’s [`draw(_:)`](/documentation/AppKit/NSView/draw(_:)) method instead.

---

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)