Search code examples
objective-cxcodetabbar

Xcode !Go from home view with button to a specific view in tab bar controller


I have a view with 3 buttons and a tabbar controller that contains 3 views. I am using the storyboard. I want go from my view to a specific view from the tabbar controller.for example i want to push the second button in the home view and i want to go directly to the second tab of my tab bar controller.


Solution

  • You can programmatically change tabs by inserting the following into you void/IBAction.

    [self.tabBarController setSelectedIndex:1];