user123 user123 - 1 month ago 17
iOS Question

Label Alignment in iOS 6 - UITextAlignment deprecated

Seems like

UITextAlignmentCenter
is deprecated in iOS 6.

I still use it and works well, but it gives a warning.

How can I fix this?

label.textAlignment = UITextAlignmentCenter;


Thanks.

Answer

In iOS6 you can use

label.textAlignment = NSTextAlignmentCenter;

Hope this helps.

Comments