---
title: "adjustedRange(from:forEditingTextSelection:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextcontentstorage/adjustedrange(from:foreditingtextselection:)"
---

# adjustedRange(from:forEditingTextSelection:)

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

## Declaration

```swift
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

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

## Discussion

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

## See Also

### Finding ranges, locations, and offsets

- [location(_:offsetBy:)](uikit/nstextcontentstorage/location(_:offsetby:).md)
- [offset(from:to:)](uikit/nstextcontentstorage/offset(from:to:).md)
