<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/BETextInput/adjustSelection(by:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "c:objc(pl)BETextInput(im)adjustSelectionByRange:completionHandler:"
  },
  "title" : "adjustSelection(by:completionHandler:)"
}
-->

# adjustSelection(by:completionHandler:)

Adjusts the selection using a range.

```
func adjustSelection(by range: BEDirectionalTextRange, completionHandler: @escaping @Sendable () -> Void)
```

```
func adjustSelection(by range: BEDirectionalTextRange) async
```

## Discussion

The argument value is a character count. The start of the current selection moves by `range.offset` characters, and the length of the selection changes by `range.length` characters.

For example, if the current selection is a word “world” in “Hello world” and the `range` is `{ -6, -2 }`, the selected text after adjustment is “Hel”.

---

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)