title: Determining If Transition Is Finished
body: <p>I have an external device that has a button. When you press this button, it switches view controllers. When I press the button slowly, they transition just fine. But, when I press the button too fast, the app crashes with the error:</p>
  
  <pre><code>Terminating app due to uncaught exception NSInternalInconsistencyException, reason: Attempting to begin a modal transition from &lt;SViewController: (numbers)&gt; to &lt;VViewController: (numbers)&gt; while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed
  </code></pre>
  
  <p>I have no idea how to fix this issue. This is the code I use to switch between view controllers. I put this if statement in each view controller (of course switching out the View Controllers):</p>
  
  <pre><code> if ([data isEqualToString: @"Switch1"]) {
          UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
          UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"VViewController"];
          vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
          [self presentViewController:vc animated:YES completion:NULL];
      }
  </code></pre>
  
  <p>The error said to check in <code>viewDidLoad', but I have no idea what code to put in</code>viewDidLoad` to determine if the transition has finished, and if it hasn't, prevent it from trying to transition again.</p>