title: Dimiss two ViewControllers one after the another:iOS
body: <p>I am trying to dismiss two view controllers one after the another, 
  In my first view controller I have kept uploading feature, which when completes the current view controller is dismissed.</p>
  
  <p>Now, after the uploading ViewController is dismissed,I come to previous viewcontroller. I want to dismiss that "previousViewController" as well.</p>
  
  <p>After the "uploadViewController" is dismissed, I call method on "PreviousViewController"</p>
  
  <p>Here is how I am trying to do it:</p>
  
  <p>In UploadViewController:</p>
  
  <pre><code>[self dismissViewControllerAnimated:YES completion:^{
  
              [previousView dismissME];
          }];
  </code></pre>
  
  <p>And now when I come to "PreviousViewController"</p>
  
  <p>Here is that <code>dismissME</code> method:</p>
  
  <pre><code>-(void)dismissME {
  
      if (![[self presentingViewController] isBeingDismissed]) {
          NSLog(@"Dismiss ME");
          [self dismissViewControllerAnimated:YES completion:NULL];
      }
  }
  </code></pre>
  
  <p>I get that "Dismiss ME" log, but the viewController is not being dismissed. </p>
  
  <p>Any ideas .. ? How to achieve this ..?</p>