Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Icons on the UIAlert Controller

Does anyone know how to add icons in the UI Alert Controller the way the Pages App has it as attached i the image below.

Thanks in advance. :)

enter image description here

like image 245
Gugulethu Avatar asked Oct 21 '25 22:10

Gugulethu


1 Answers

Yes that is possible. You can try to set image property 0f action. You should probably try out following code

var okAction = UIAlertAction(title: "OK", style: .Default, handler: nil)
let img = UIImage(named: "ico_ok.png")
action.setValue(img, forKey: "image")
alert.addAction(action)
like image 166
Vishnu gondlekar Avatar answered Oct 24 '25 11:10

Vishnu gondlekar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!