Skip to content

Instantly share code, notes, and snippets.

@jault3
Created March 25, 2014 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jault3/9754798 to your computer and use it in GitHub Desktop.
Save jault3/9754798 to your computer and use it in GitHub Desktop.
TabBarController
PlaylistUITabBarController *tabBarController = [[PlaylistUITabBarController alloc] init];
//playlist ^^ is the subclass of UITabBarController
//these next two are just basic ViewControllers
_futureTrackViewController = [[FutureTrackViewController alloc] initWithNibName:nil bundle:nil];
_futureTrackViewController.delegate = self;
_futureTrackViewController.tabBarController = tabBarController;
_pastTrackViewController = [[PastTrackViewController alloc] initWithNibName:nil bundle:nil];
_pastTrackViewController.delegate = self;
_pastTrackViewController.tabBarController = tabBarController;
tabBarController.viewControllers = @[_futureTrackViewController, _pastTrackViewController];
tabBarController.tabBar.selectionIndicatorImage = [UIImage imageNamed:@"tab_bar_active"];
tabBarController.tabBar.barStyle = UIBarStyleBlack;
tabBarController.tabBar.backgroundImage = [UIImage new];
tabBarController.tabBar.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tab_bar_inactive"]];
[tabBarController setSelectedIndex:0]; //this doesn't do anything
//controller below here is a UINavigationController
[_controller pushViewController:tabBarController animated:YES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment