title: Dismissing two modal view controllers
body: <p>I have found several questions about this but the answers do not resolve my problem.</p>
  
  <p>I have two controllers that I have presented using presentModalViewController.</p>
  
  <p>I added modalTransitionStyle to the first controller that is called by Main Controller. The first controller presented the second controller normally (without transition style).</p>
  
  <pre><code>FirstVC *first = [[FirstVC alloc] initWithNibName:@"FirstVC" bundle:nil];
  first.modalTransitionStyle = UIModalTransitionStylePartialCurl;
  [self presentModalViewController:first animated:YES];
  
  SecondVC *second = [[SecondVC alloc] initWithNibName:@"SecondVC" bundle:nil];
  [self presentModalViewController:second animated:YES];
  </code></pre>
  
  <p>This is the code I used to go to the MainVC:</p>
  
  <pre><code>[self.presentingViewController.presentingViewController dismissModalViewControllerAnimated:YES];
  </code></pre>
  
  <p>And this is what happened:</p>
  
  <p><img src="https://i.stack.imgur.com/aYoGz.png" alt="enter image description here"></p>
  
  <p>The page didn't uncurl. What's the reason I'm encountering this?</p>