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

You may be wondering how to programatically change global Tint Colour of your iOS App in Xcode project. i.e. Changing all UIBarButtonItems tint colour at once

 
Without selecting every single button & changing tint for every single one & for button added there after.

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

 
Solution:

 
In you iOS App’s Xcode projects AppDelegate.m under function ‘didFinishLaunchingWithOptions’ add below line

 

self.window.tintColor = [UIColor brownColor];

 
Above code will change global tint colour to brown,

 
if write black instead brown global tint colour will change to black

 

self.window.tintColor = [UIColor blackColor];

 
& if change it to red it will change 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;
}

 
Hope you find this useful,

 
Thanks & Regards
Mandar Apte

Leave a Reply

Your email address will not be published. Required fields are marked *