Question

I have a Tab Bar app with a navigation controller on one tab.

I want to push a new view controller, but have it animate in from the left.

What I have is this:

CATransition *transition = [CATransition animation];
transition.duration = 0.8;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
transition.delegate = self;        

controller.hidesBottomBarWhenPushed = YES;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:controller animated:YES];

Everything pushes in from the left, except for the tab bar, which always slides out to the left (and transition.duration has no effect on that either).

Is there a way to get the taBar to slide out in the same direction & speed with the rest of the view?

(I've also tried using pushModalViewController, but that has various graphical glitches instead).

Was it helpful?

Solution

It seems to me that you are trying to animate only self.navigationController in your code; since the UITabBar is outside of it, it seems reasonable that it does not get animated as you like (I think it gets animated only as an after effect of animating the inner view, but you have no control on it).

What I would try to do is accessing your UITabBarController's view and add an animation to its CALayer as well (or exclusively to that, you can try different possibilities).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top