UITabBarItem setFinishedSelectedImage: deprecated in iOS7

ios, ios7, objective-c, uiimage

Solution

If you're are trying to achieve displaying of the actual image at the UITabBar then use the following code.

[yourTabBarItem setImage:[[UIImage imageNamed:@"more.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

and if you want to display image in original condition for the selected then use the following

[yourTabBarItem setSelectedImage:[[UIImage imageNamed:@"more.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

these two are alternative to

setFinishedSelectedImage:  withFinishedUnselectedImage:

Problem

`setFinishedSelectedImage:withFinishedUnselectedImage:` is deprecated in iOS7. Apple recommends to use setters of `image` and `selectedImage` with `UIImageRenderingModeAlwaysOriginal` instead. I can't find any example of how to use `UIImageRenderingModeAlwaysOriginal`. So the question is really simple: how to set images for `UITabBarItem` in iOS7?

Original source