Uialertcontroller Text Alignment

how can change text - alignment to the left in UIAlertAction in swift

I think that you can't make this using default UIAlertController.

But you can try to use custom framework, like OKAlertController.

It has extended customisation

https://github.com/OlehKulykov/OKAlertController

UIAlertController not displaying text in center when RTL switch in iOS

The problem is that this line is totally illegal:

alert.setValue(messageText, forKey: "attributedMessage")

You are working behind the runtime’s back. Your results will be unpredictable, and your app might be rejected from the App Store.

If you want control over formatting that UIAlertController doesn’t give you, don’t use UIAlertController. Make a real view controller instead.



Related Topics



Leave a reply



Submit