views:

29

answers:

1

CATransitions can be used to animate transitions in Navigation Controllers when drilling down. However when using Back button og Navigation Controller (going back up) animation is still slide out. Does anyone know how to attach CATransition to the Back button of Navigation Controller? thanks.

Code used to animate when "drilling down":

CATransition *transition = [CATransition animation]; transition.duration = 1; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromTop; transition.delegate = self; [self.navigationController.view.layer addAnimation:transition forKey:nil];

A: 

I'm not sure I understand the question. UINavigationController already uses a slide transition when switching views. If you want to attach a custom transition to the back button, you're going to have to create a custom back button and connect it to an action that will run your CATransition code.

macatomy
That's the thing. UINavigationController uses slide transitions and I need it to flip.
vilo