My most popular blog post is how to change the color of a UIBarButtonItem. It’s something that lots of people want to do, but it involved some pretty weird hacks to get it working.
Now that iOS 5 is out, I can talk about a better way to do it. Apple will now let you set the
tintColor: property on the bar button item. That’s it. No more weird hacks with images or segmented controls.
There’s even a cool new appearance proxy that will let you change all controls from your app with a single line of code. (More about UIAppearance here)
So lets say you want every UIBarButtonItem in your application to be blue. That’s easy just call
[UIBarButtonItem appearance] setTintColor:[UIColor blueColor]]
Remember, this is iOS 5 only. If you want your app to support iOS 4, you’ll have to do it the old way.