I have a UINavigationController setup in my storyboard and I have made a custom segue class which you can see below which nicely fades between my views (rather than a bog standard push).
However, when I tap that back button my nav controller gave me, I get a push animation which I don't want, I want to use that fade! I also don't want to have to have segues in my storyboard going both ways as it just gets messy.
Custom fade segue:
-(void)perform
{
__block UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
__block UIViewController *destinationController = (UIViewController*)[self destinationViewController];
[UIView transitionWithView:sourceViewController.navigationController.view duration:1.0 options:UIViewAnimationOptionTransitionCrossDissolve
animations:^
{
[sourceViewController.navigationController pushViewController:destinationController animated:NO];
}
completion:^(BOOL finished)
{
NSLog(@"Transition Completed");
}];
}
Edit
Perhaps I should simplify. How can I do a cross dissolve fade between two view controllers in a UINavigationController which pushes and pops views instead of the standard left-right siding animation?