Can I change colors of the UIAlertController
? 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.
Thanks!
You could just change the tintColor
of the underlying view, however, due to a known bug introduced in iOS 9 (https://openradar.appspot.com/22209332), the tintColor is overridden by the application window's tintColor
.
You can either:
Change the app tintColor
in the AppDelegate.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
self.window.tintColor = UIColor.redColor()
return true
}
Reapply the color in the completion block.
self.presentViewController(alert, animated: true, completion: {() -> Void in
alert.view.tintColor = UIColor.redColor()
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With