<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextContentStorage/adjustedRange(from:forEditingTextSelection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextContentStorage(im)adjustedRangeFromRange:forEditingTextSelection:"
  },
  "title" : "adjustedRange(from:forEditingTextSelection:)"
}
-->

# adjustedRange(from:forEditingTextSelection:)

Returns the text range, if any, in the backing store that required manual adjustment after editing.

```
func adjustedRange(from textRange: NSTextRange, forEditingTextSelection: Bool) -> NSTextRange?
```

## Parameters

`textRange`

The text range.

`forEditingTextSelection`

A Boolean value that indicates if `textRange` is for the text selection associated with the edit session.

## Return Value

The  adjusted `TextRange` for the editing session, or `nil` of no adjustment was necessary

## Discussion

When `textRange` is intersecting or following the current edited range, the method returns an adjusted range for the modification in the editing session.

---

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)