How can I change the color of the UIAlertView
button title.
The Travis Weerts answer should work if you are using a UIAlertController
. For those using UIAlertView
, you can use the UIView
appearance settings.
You can aim the alerts component this way on iOS < 9 :
[[UIView appearanceWhenContainedIn:[UIAlertView class], nil] setTintColor:[UIColor redColor]];
[[UIView appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor redColor]];
And on iOS 9 :
[[UIView appearanceWhenContainedInInstancesOfClasses:@[[UIAlertView class]]] setTintColor:[UIColor redColor]];
[[UIView appearanceWhenContainedInInstancesOfClasses:@[[UIAlertController class]]] setTintColor:[UIColor redColor]];