How to change global tint color on iOS 9?

I have the following code which works perfectly on iOS 8:


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // some app initialization code comes here
    // ...

    // set the global tint color - works great on iOS 8!
    [[UIView appearance] setTintColor:[self myGlobalTintColor]];
}


However, when I run the same code on iOS 9 beta 5 (XCode 7, beta 6) the following appears when UIActionSheet or UIAlertController is displayed (you will need to copy-paste the following link in your Browser, otherwise it won't be opened)


http://i.stack.imgur.com/eJaGM.png


As you can see, the "Cancel" button does not accept the global tint color.


Is this a known issue with iOS 9, or am I missing some code?

If it used to work under iOS 8 and it doesn't work now, then either an intentional change was made to iOS 9 disabling custom tints for Cancel (check the release notes to see for sure), or it's a bug. The Bug Reporter tool is here: bugreport.apple.com

Hi,


I use

self.window.tintColor =

to set the tintColor.

As the actual tintColor for each view is searched in the view hierachy ascending from and starting with the view itself, the window's tintColor is used for all views in the window's view hierachy.


Dirk

Hi Dirk, thak you for your suggestion. Using self.window.tintColor is not affecting UIActionSheet and UIAlertView which I must use since my app still supports iOS 7.

I was hoping that an Apple's developer would suggest if this is a bug or a new behavior on iOS 9, but I guess I should report a bug anyway. Thanks for your reply.

Ah, ok. You're right. Since I've changed to UIAlertController I wasn't aware of that issue.


Dirk

The UIAlertController is also affected.

How to change global tint color on iOS 9?
 
 
Q