When customizing an UITabBar
I have two ways doing this, both work but I'm curious what's the best approach and what advantages, disadvantages I have with both ways?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UITabBarController *tbc = (UITabBarController *)self.window.rootViewController;
UITabBar *tb = tbc.tabBar;
// 1. Customizing UITabBar using appearance proxy:
[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"tabbar.png"]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"tabbar_selected.png"]];
// 2. Doing the same by setting the properties directly:
// tb.backgroundImage = [UIImage imageNamed:@"tabbar.png"];
// tb.selectionIndicatorImage = [UIImage imageNamed:@"tabbar_selected.png"];
return YES;
}