Try this, and see if it works. For the before animation, implement tabBarController:shouldSelectViewController:, and put your animation code there. Return YES in the completion block of the animation so the switch to the new tab will be delayed until your animation is over. The after animation should be put in the viewDidAppear method of the tab you're moving to.
After Edit:
It's a little more complicated than my answer above, so it has to be done by calling a method in tabBarController:shouldSelectViewController: that does the animation, then selects the view controller to move to -- by doing the selection in code, the delegate method won't be called for a second time. Here's an example where I just move a view in the animation block,
-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
[self completeTabChangeToController:viewController];
return NO;
}
-(void)completeTabChangeToController:(UIViewController *) controller {
self.bottomCon.constant = 50;
[UIView animateWithDuration:.5 animations:^{
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
[self.tabBarController setSelectedViewController:controller];
}];
}