0
votes

I currently have an app with 3 views

  1. Screen 1 - uses a 'show' segue to go to Screen 2
  2. Screen 2 - uses a 'modal' segue to go to Screen 3
  3. Screen 3

I have an unwind segue in Screen 1 and invoke this unwind segue from Screen 2 and Screen 3.

Currently, when I invoke Screen 1's unwind segue from Screen 3, it animates as a modal view that is closing.

Is it possible to have this unwind segue animate an a standard "pop" segue, such as when a screen pops off the normal navigation stack?

1
If you're presenting a modal view controller, it is no longer a part of the navigation controller hierarchy, so there is no way to get the animation you're looking for. Besides, that'd be in violation the Human Interface Design Guidelines. Let it be.duci9y

1 Answers

0
votes

I was able to accomplish what I wanted by creating a different segue for the Modal View. There is some additional things about my interface that I did not want to try to explain, but Screen 3 now replaces Screen 2, without a modal segue. Then when I invoke the unwind segue on Screen 3, it unwinds using the push segue from Screen 1.

Here is the custom segue I used between Screen 2 and Screen 3:

-(void)perform {
    UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
    UIViewController *destinationController = (UIViewController*)[self destinationViewController];
    UINavigationController *navigationController = sourceViewController.navigationController;
    // Pop to root view controller (not animated) before pushing
    [navigationController popToRootViewControllerAnimated:NO];
    [navigationController pushViewController:destinationController animated:NO];
}