Use NSTextAlignment instead of UITextAlignment (introduced in iOS 6)