---
title: "setLayoutOrientation(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextview/setlayoutorientation(_:)"
---

# setLayoutOrientation(_:)

Changes the receiver’s layout orientation and invalidates the contents.

## Declaration

```swift
func setLayoutOrientation(_ orientation: NSLayoutManager.TextLayoutOrientation)
```

## Parameters

- `orientation`: The text layout orientation.

## Discussion

Discussion Unlike other NSTextView properties, this is not shared by sibling views.  It also rotates the bounds 90 degrees, swaps horizontal and vertical bits of the autoresizingMask mask, and reconfigures isHorizontallyResizable and isVerticallyResizable properties accordingly.  Also, if enclosingScrollView returns non-nil, it reconfigures the horizontal and vertical ruler views, the horizontal and vertical scrollers, and the frame.

## See Also

### Changing layout orientation

- [changeLayoutOrientation(_:)](appkit/nstextview/changelayoutorientation(_:).md)
