---
title: NSTextLayoutOrientationProvider
framework: appkit
role: symbol
role_heading: Protocol
path: appkit/nstextlayoutorientationprovider
---

# NSTextLayoutOrientationProvider

A set of methods that define the orientation of text for an object.

## Declaration

```swift
protocol NSTextLayoutOrientationProvider
```

## Overview

Overview In macOS, the NSTextContainer and NSTextView classes adopt this protocol; in iOS, only the NSTextContainer class implements it. An NSTextContainer object returns the value from its associated text view when present; otherwise, it returns NSLayoutManager.TextLayoutOrientation.horizontal by default. If you define a custom NSTextContainer object, you can override this method and return NSLayoutManager.TextLayoutOrientation.vertical to support laying out text vertically.

## Topics

### Getting layout orientation

- [layoutOrientation](appkit/nstextlayoutorientationprovider/layoutorientation.md)
- [NSLayoutManager.TextLayoutOrientation](appkit/nslayoutmanager/textlayoutorientation.md)

## Relationships

### Conforming Types

- [NSTextContainer](appkit/nstextcontainer.md)
- [NSTextView](appkit/nstextview.md)

## See Also

### Layout

- [Using TextKit 2 to interact with text](uikit/using-textkit-2-to-interact-with-text.md)
- [NSTextLayoutManager](appkit/nstextlayoutmanager.md)
- [NSTextContainer](appkit/nstextcontainer.md)
- [NSTextLayoutFragment](appkit/nstextlayoutfragment.md)
- [NSTextLineFragment](appkit/nstextlinefragment.md)
- [NSTextViewportLayoutController](appkit/nstextviewportlayoutcontroller.md)
