0

I have a table based app and would like to add a tab bar to the bottom to switch between this table and other views.

What is the msot hassle free way to do this ? Can I just wire in a tab view controller underneath the table view?

Thanks,

Martin

GuybrushThreepwood
  • 5,598
  • 9
  • 55
  • 113

1 Answers1

1

You actually have to load your view controllers into a UITabBarController. So if you have a tableViewController, viewController1, and viewController 2, you want to add all those to the tabBarController.

UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers:[NSArray arrayWithObjects:tableViewController, vc1, vc2];

[self.window addSubView:tabBarController.view];
[self.window makeKeyAndVisible];
ryanbillingsley
  • 215
  • 4
  • 12