0

I have an alert controller that I set to a new tint color with this line of code:

alertController.view.tintColor = UIColor(red: 0.59, green: 0.59, blue: 0.59, alpha: 1.0)

The color does show correctly, but once the alert action is tapped, it changes back to the default blue color automatically. How can I make it so that the tint color does not change back to default. I have heard of the func tintColorDidChange() but I am unsure of how to use it?

1 Answers1

0

You can try this. It has been discussed here

you should add the same code in presentViewController completion handler

presentViewController(alert, animated: true) { 
    alert.view.tintColor = UIColor(red: 0.59, green: 0.59, blue: 0.59, alpha: 1.0)
}
Community
  • 1
  • 1
xmhafiz
  • 3,482
  • 1
  • 18
  • 26