So I have 2 tabs in my tab bar controller.
I have a button in Tab 2, and if I click that, control needs to be passed to Tab 1, and it should become the present view controller.
//I should not use navigation for this because the view would navigate
the present view to the view in tab 1 ; but the tab will still indicate Tab 2//
I just need it to go to tab 1 when I click the button.
When you click the button, just have it send the following
That will tell it to switch to the first tab in its index (Tab 1)
If you want to add animation to the change, you’ll use
transitionFromView:toView:duration:options:completion:. And to implement this, you’ll use something like this:The options give you control how it transitions, and there’s a nice list of all the stuff you can do. Then the completion block lets you specify what to do once you’re finished. In this case, it will switch to tab 1 so it is the new primary controller