<!--
{
  "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" : "CoreText",
  "identifier" : "/documentation/CoreText/CTTextAlignment/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Text",
      "CoreText"
    ],
    "preciseIdentifier" : "c:@F@NSTextAlignmentToCTTextAlignment"
  },
  "title" : "init(_:)"
}
-->

# init(_:)

Converts a UIKit text alignment constant value to the matching constant value that Core Text uses.

```
init(_ nsTextAlignment: NSTextAlignment)
```

## Parameters

`nsTextAlignment`

The UIKit text alignment constant you want to convert.

## Return Value

The Core Text alignment that corresponds to the value specified in `nsTextAlignment`.

## Discussion

Use this function when you need to map between the UIKit and Core Text 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)