UIAlertViewController tint color inherited from main window

Hi Guys,


I am having some trouble setting the UIApperance property for UIAlertController. I am trying to change the color for Cancel Button but the following code does not work.


[[UICollectionViewCell appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:1]];


Has someone faced a similar issue ? its specific to iOS9


Thanks

Akhilesh

The docs are a bit outdated here but the statement is still true:


IMPORTANT
Setting the

tintColor
property by using the appearance proxy APIs is not supported in iOS 7.


https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/AppearanceCustomization.html#//apple_ref/doc/uid/TP40013174-CH15-SW3


So instead of setting tintColor through appearance you must set it directly on the view you want to tint or one of it's ancestors.

UIAlertViewController tint color inherited from main window
 
 
Q