These constants specify text alignment.
SDKs
- iOS 6.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Frameworks
- UIKit
- App
Kit
Declaration
enum NSTextAlignment : Int
These constants specify text alignment.
SDKs
Frameworks
enum NSTextAlignment : Int
case left
Text is visually left aligned.
case right
Text is visually right aligned.
case center
Text is visually center aligned.
case justified
Text is justified.
case natural
Use the default alignment associated with the current localization of the app. The default alignment for left-to-right scripts is NSText
, and the default alignment for right-to-left scripts is NSText
.
init(CTText Alignment)
Converts a Core Text alignment constant value to the matching constant value used by UIKit.