<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/BEDirectionalTextRange/init(offset:length:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "s:So22BEDirectionalTextRangea6offset6lengthABSi_Sitcfc"
  },
  "title" : "init(offset:length:)"
}
-->

# init(offset:length:)

Creates a range for a text selection that also specifies a direction.

```
init(offset: Int, length: Int)
```

## Discussion

The sign of the `length` argument determines the selection’s direction from the `offset` argument.

---

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)