<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextInput/firstRectForCharacterRange:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextInput(im)firstRectForCharacterRange:"
  },
  "title" : "firstRectForCharacterRange:"
}
-->

# firstRectForCharacterRange:

Returns the first frame rectangle for characters in the given range, in screen coordinates.

```
- (NSRect) firstRectForCharacterRange:(NSRange) range;
```

## Parameters

`range`

The character range whose frame is returned.

## Return Value

The frame rectangle for the given range of characters.

## Discussion

If `theRange` spans multiple lines of text in the text view, the rectangle returned is the one for the characters in the first line. If the length of `theRange` is 0 (as it would be if there is nothing selected at the insertion point), the rectangle coincides with the insertion point, and its width is 0.

---

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)