I want to change tab through code with animation. Exact scenario is that there are 2 tabs with below hierarchy.
First tab
- Navigation controller
- Log
I'm Sorry Geek, I was disconnected on weekend.
The solution that I took in my app was make a method which call to the popToRootViewControllerAnimated: and then send a performSelector: message to self passing that created method as a selector:
- (void)delayPopAnimation {
[self.navigationController popToRootViewControllerAnimated:YES];
}
// in logoutButtonPressed make some like this
self.tabBarController.selectedIndex = 0;
[self performSelector:@selector(delayPopAnimation) withObject:nil afterDelay:1.5];
Maybe it is not the best and well performed solution, but it's an option because do the work. It will select the tab and after a 1.5 second delay, the animation will take place. Hope it helps.