<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSTextAlignment",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@NSTextAlignment"
  },
  "title" : "NSTextAlignment"
}
-->

# NSTextAlignment

Constants that specify text alignment.

```
enum NSTextAlignment
```

## Topics

### Constants

[`NSTextAlignmentLeft`](/documentation/UIKit/NSTextAlignment/left)

Text is left-aligned.

[`NSTextAlignmentRight`](/documentation/UIKit/NSTextAlignment/right)

Text is right-aligned.

[`NSTextAlignmentCenter`](/documentation/UIKit/NSTextAlignment/center)

Text is center-aligned.

[`NSTextAlignmentJustified`](/documentation/UIKit/NSTextAlignment/justified)

Text is justified.

[`NSTextAlignmentNatural`](/documentation/UIKit/NSTextAlignment/natural)

Text uses the default alignment for the current localization of the app.

### Initializers

[`NSTextAlignmentFromCTTextAlignment`](/documentation/UIKit/NSTextAlignment/init(_:))

Converts a Core Text alignment constant value to the matching constant value in UIKit.

[`init(rawValue:)`](/documentation/UIKit/NSTextAlignment/init(rawValue:))

## Relationships

### Conforms To

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)