I am pushing a UIViewController in a navigation stack using the following code
[UIView animateWithDuration:0.75
animations:^{
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[self.navigationController pushViewController:ViewController animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
}];
Now when I press back I want it to do the same animation but its not working. Any idea why?
in ViewController.m
[UIView animateWithDuration:0.75
animations:^{
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[self.navigationController popToRootViewControllerAnimated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
}];
In Swift 4:
Push:
Pop:
Actually the transition should be done like this
//MainView
// in viewcontroller