---
title: "init(_:)"
framework: coretext
role: symbol
role_heading: Initializer
path: "coretext/cttextalignment/init(_:)"
---

# init(_:)

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

## Declaration

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

## Parameters

- `nsTextAlignment`: The UIKit text alignment constant you want to convert.

## Return Value

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

## Discussion

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