<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSTextLayoutOrientationProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextLayoutOrientationProvider"
  },
  "title" : "NSTextLayoutOrientationProvider"
}
-->

# NSTextLayoutOrientationProvider

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

```
protocol NSTextLayoutOrientationProvider
```

## Overview

In macOS, the [`NSTextContainer`](/documentation/UIKit/NSTextContainer) and <doc://com.apple.documentation/documentation/AppKit/NSTextView> classes adopt this protocol; in iOS, only the [`NSTextContainer`](/documentation/UIKit/NSTextContainer) class implements it. An [`NSTextContainer`](/documentation/UIKit/NSTextContainer) object returns the value from its associated text view when present; otherwise, it returns [`NSLayoutManager.TextLayoutOrientation.horizontal`](/documentation/UIKit/NSLayoutManager/TextLayoutOrientation/horizontal) by default. If you define a custom [`NSTextContainer`](/documentation/UIKit/NSTextContainer) object, you can override this method and return [`NSLayoutManager.TextLayoutOrientation.vertical`](/documentation/UIKit/NSLayoutManager/TextLayoutOrientation/vertical) to support laying out text vertically.

## Topics

### Getting layout orientation

[`layoutOrientation`](/documentation/UIKit/NSTextLayoutOrientationProvider/layoutOrientation)

The default layout orientation.

[`TextLayoutOrientation`](/documentation/UIKit/NSLayoutManager/TextLayoutOrientation)

Constants that describe the text layout orientation.

## Relationships

### Conforming Types

[`NSTextContainer`](/documentation/UIKit/NSTextContainer)

---

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)