I have a custom segue:
-(void)perform {
__block UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
__block UIViewController *destinationController = (UIViewController*)[self destinationViewController];
float duration = 0.5;
NSLog(@"FlipSegue.m - source:%@ dest:%@", sourceViewController, destinationController);
if (self.isUnwinding) {
NSLog(@"FlipSegue.m - isUndwinding - Flipping View 2 to View 1");
//[sourceViewController.navigationController dismissViewControllerAnimated:NO completion:nil];
[UIView transitionWithView:sourceViewController.navigationController.view duration:duration
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
[sourceViewController.navigationController dismissViewControllerAnimated:NO completion:nil];
}
completion:NULL];
} else {
NSLog(@"FlipSegue.m - Going Forward - Flipping View 1 to View 2");
//[sourceViewController.navigationController pushViewController:destinationController animated:NO];
[UIView transitionWithView:sourceViewController.navigationController.view duration:duration
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
[sourceViewController.navigationController pushViewController:destinationController animated:NO];
}
completion:NULL];
}
}
I have setup the segue
and unwind segue
using a storyboard
.
I have subclassed UINavigationController
and am getting the custom unwind segue using - (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)
When I invoke the segue from View 1
to View 2
, it works as expected.
When I invoke the unwind segue, View 2
flips, but displays View 2
again. The isUnwinding
portion of code fires but View 1
never reappears.
Any tips about how to fix this issue would be greatly appreciated.