title: Unwind with more than 1 segue using iOS 7 UIViewController transition animations
body: <p>I am using the UIViewController animated transitions introduced in iOS7. I am able to produce some really great transitions going back and forth between VC's using segues etc. </p>
  
  <p>Take a look at my picture below:</p>
  
  <p><img src="https://i.stack.imgur.com/adixA.png" alt="enter image description here"></p>
  
  <p>I can very easily go back and forth if it is just one segue/vc at a time. For example if, I go from Screen 1 to Screen 2, the animation works perfect. And then say I go back to 1 or forward to 3, it works perfectly. </p>
  
  <p>But, if you notice on screen 4 at the bottom there is a button that says "Back To Screen 1"—this is an unwinding segue to screen 1. The issue is, I can't get the transition animation to work. In fact, the delegate methods never get called.</p>
  
  <p>Here is how I have it set up (for example animating from screen 2 to 3):</p>
  
  <pre><code>//This is found in screen 2's view controller .m
  
  -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
  
      if ([segue.identifier isEqualToString:@"screen2to3"]) {
  
          UIViewController *destination = segue.destinationViewController;
          destination.transitioningDelegate = self;
          destination.modalTransitionStyle = UIModalPresentationCustom;
  
      }
  }
  
  - (id&lt;UIViewControllerAnimatedTransitioning&gt;)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
  
      STSlideAnimation *animator = [STSlideAnimation new];
      animator.presenting = YES;
      return animator;
  }
  
  - (id&lt;UIViewControllerAnimatedTransitioning&gt;)animationControllerForDismissedController:(UIViewController *)dismissed {
  
      STSlideAnimation *animator = [STSlideAnimation new];
      return animator;
  }
  
  //This is the unwinding segue action
  
  -(IBAction)returnToScreen2:(UIStoryboardSegue *)segue{
  
  }
  </code></pre>
  
  <p>This works perfect going both to screen3 and back to screen2. The animation gets called both ways. However, I can't get any animation to work when going back more than one vc at a time. Any ideas? Let me know if I need to post more sample code.</p>