GuybrushThreepwood
GuybrushThreepwood

Reputation: 5616

Adding Tab Bar View into an Existing Table Based App - iPhone

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

Upvotes: 0

Views: 1884

Answers (1)

ryanbillingsley
ryanbillingsley

Reputation: 215

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];

Upvotes: 1

Related Questions