opensource
opensource

Reputation: 23

Replace ViewController of a tab in a TabBarControlller

I have a TabBarController & 4 tabs with their individual ViewControllers (embedded in NavigationController/TableViewController) created using interface. Dynamically added multiple BarButtons on The ViewController1. The current view Controller of Tab 1 has to be replaced on click of a BarButton. How should I go about it?

Upvotes: 1

Views: 1939

Answers (1)

Saheb Roy
Saheb Roy

Reputation: 5957

This is the snippet you should play around with, to get the hang of it more

self.tabBarController.selectedIndex = 1;

I have answered this question before too, you can refer to that answer as well here

[self.tabbarController setViewControllers:arrayOfNewViewControllers];
self.tabbarController.selectedIndex = 0;

Upvotes: 2

Related Questions