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

Published by Mandar Apte

Mandar is a Mumbai-based multi-disciplinary designer with UX/UI, Logo, Symbol, and Brand Identity design expertise. He currently runs his Mudrkashar Linguistic Apple iPhone, iPad, and Mac app business in the heart of Mumbai city.

Join the Conversation

2 Comments

  1. 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. 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 comment

Leave a Reply