---
title: "setBaseWritingDirection(_:for:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinput/setbasewritingdirection(_:for:)"
---

# setBaseWritingDirection(_:for:)

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

## Declaration

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

## Mentioned in

Integrating custom browser text views with UIKit

## Discussion

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.
