<!--
{
  "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/setBaseWritingDirection(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "c:objc(pl)BETextInput(im)setBaseWritingDirection:forRange:"
  },
  "title" : "setBaseWritingDirection(_:for:)"
}
-->

# setBaseWritingDirection(_:for:)

Informs the text view of the writing direction for a given range of text.

```
func setBaseWritingDirection(_ writingDirection: NSWritingDirection, for range: UITextRange)
```

## Discussion

- writingDirection: Whether the writing direction is left-to-right, right-to-left, or the natural direction for the current script.
- range: The range in the text view’s document for which the writing direction applies.

---

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)