Skip to content

Instantly share code, notes, and snippets.

@thoretton-edwin
Last active August 29, 2015 13:56
Show Gist options
  • Save thoretton-edwin/9015998 to your computer and use it in GitHub Desktop.
Save thoretton-edwin/9015998 to your computer and use it in GitHub Desktop.
iOS TabBarController as rootViewController
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.tabBarController = [[UITabBarController alloc] init];
SquaresViewController *squaresViewController = [[SquaresViewController alloc] initWithNibName:@"SquaresViewController" bundle:nil];
ScrollViewController *scrollViewController = [[ScrollViewController alloc] initWithNibName:@"ScrollViewController" bundle:nil];
TableView* tableViewController =[[TableView alloc]initWithStyle:UITableViewStylePlain];
self.tabBarController.viewControllers = @[squaresViewController,scrollViewController,tableViewController];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment