Mandar Apte

UI/UX Designer from Mumbai, Maharashtra, India.

How programmatically change the global Tint Colour of your iOS App in the Xcode project. i.e. Changing all UIBarButtonItems tint colours at once.

You may wonder how to programmatically change the global Tint Colour of your iOS App in the Xcode project. i.e. Changing all UIBarButtonItems tint colours at once

Without selecting every single button & changing the tint for every single one & for the buttons added after that.

Here is the solution. As simple as a single line of code will remove the hassle from your mind & you can even re-change the global tint colour again by changing a few letters

Solution:
In your iOS App’s Xcode projects AppDelegate.m under function ‘didFinishLaunchingWithOptions’ add the below line

self.window.tintColor = [UIColor brownColor];

Above code will change global tint colour to brown,

If you write black instead of brown, the global tint colour will change to black

self.window.tintColor = [UIColor blackColor];

Changing it to red will change the global tint colour to red. It is as simple as that.

self.window.tintColor = [UIColor redColor];

Your ‘didFinishLaunchingWithOptions’ function will look like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    self.window.tintColor = [UIColor brownColor];

    return YES;
}

I hope you find this useful,

Thanks & Regards
Mandar Apte

Comments

2 responses to “How programmatically change the global Tint Colour of your iOS App in the Xcode project. i.e. Changing all UIBarButtonItems tint colours at once.”

  1. Kimaya Avatar
    Kimaya

    This is not working for me. When the app launches, I want all the tab bar icons to be white. My tab bar colour is purple, which I have done, But only the selected is white, unselected are gray. Please help

  2. Kimaya Avatar
    Kimaya

    This is not working for me. When the app launches, I want all the tab bar icons to be white. My tab bar colour is purple, which I have done, But only the selected icon is white, unselected icons are gray. Please help

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.