Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I cross dissolve when pushing views on a UINavigationController in iOS 7?

Tags:

If I simply call the push method with:

[self.navigationController pushViewController:viewController animated:YES]; 

then it uses a push animation. How do I change it to use a cross dissolve animation, like I can with a modal segue?

like image 475
user3261697 Avatar asked May 08 '14 00:05

user3261697


1 Answers

You can use a CATransition as demonstrated in this answer:

CATransition* transition = [CATransition animation]; transition.duration = 0.5; transition.type = kCATransitionFade; [self.navigationController.view.layer addAnimation:transition forKey:nil]; [self.navigationController pushViewController:viewController animated:NO]; 
like image 56
michaels Avatar answered Sep 20 '22 18:09

michaels