Center text in a UILabel

Viewed 58816

How do you center the text inside a UILabel?

9 Answers

As of Xcode 10.2.1 use:

UIlabel.textAlignment = NSTextAlignment.center

Using UIBUILDER (Swift 4) (EZ!)

Center UILabel text most easily using the "Alignment" property inside the label's Attributes Inspector. (fig. 1)

"Figure 1"

Related