3

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: enter image description here

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?

7
  • 1
    Might have something to do with the fact that UIActionSheet is deprecated as of iOS 8.3. From the docs: UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead
    – sbarow
    Aug 26, 2015 at 11:09
  • Thanks for tip. I just tried using UIAlertController instead of UIActionSheet but it didn't fix the issue. Any other suggestions?
    – Joshua
    Aug 26, 2015 at 11:47
  • 1
    Have a look at this stackoverflow.com/a/26222502/1186243 note the last comment.
    – sbarow
    Aug 26, 2015 at 12:04
  • 1
    Do you refer to the last answer suggesting to use [[UIView appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor blackColor]] ? If yes, then I already tried it, and it has no effect on iOS 9 Beta 5.
    – Joshua
    Aug 26, 2015 at 13:04
  • 1
    The UIAlertController tinting is not working properly in iOS 9 GM, see this radar.
    – albertamg
    Sep 11, 2015 at 13:19

2 Answers 2

2

In iOS 9.0 it seems only changing the window tint helps nothing else seems to work, including the appearanceWhenContainedIn: trick.

1

While using UIAlertController for ActionSheet, make sure to set the tint color after presenting the alert Controller.

activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: appActivities)
presentViewController(activityVC!, animated: true, completion: nil)
activityVC?.view.tintColor = UIColor.snapdealBlueColor()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.