<!--
{
  "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/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@F@NSTextAlignmentFromCTTextAlignment"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

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

```
init(_ ctTextAlignment: CTTextAlignment)
```

## Parameters

`ctTextAlignment`

The Core Text alignment constant to convert.

## Return Value

The UIKit text alignment that corresponds to the value specified in `ctTextAlignment`.

## Discussion

Use this function when you need to map between the Core Text and UIKit constants for text alignment.

---

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)