Beginner Beginner - 2 years ago 164
iOS Question

How to change tint color of UIAlertController?

Can I change colors of the

? A standard color is a blue color. And it's much close to the standard iOS apps. If it's customizable? How can I change colors of this? For example a button color.


Answer Source

You could just change the tintColor of the underlying view, however, due to a known bug (, the tintColor is overridden by the application window's tintColor.

You can either:

  1. Change the app tintColor in the AppDelegate.

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
        self.window.tintColor = UIColor.redColor()
        return true
  2. Reapply the color in the completion block.

    self.presentViewController(alert, animated: true, completion: {() -> Void in
        alert.tintColor = UIColor.redColor()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download