Created
March 25, 2014 03:39
-
-
Save jault3/9754798 to your computer and use it in GitHub Desktop.
TabBarController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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