title: Trigger UIAlertAction of a UIAlertController programmatically
body: <p>I want to dismiss my UIAlertController with a click on the 'Cancel' button when my app goes in to background.</p>
  
  <p>I've set up the background notification with</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];
  </code></pre>
  
  <p>Then in my appDidEnterBackground function I have:</p>
  
  <pre><code>- (void)appDidEnterBackground {
      if (_alertController) {
          UIAlertAction *cancelAction = [[_alertController actions] objectAtIndex:0];
  
          //HERE: is there a way to trigger the cancelAction??
  
          [_alertController dismissViewControllerAnimated:NO completion:nil];
      }
  }
  </code></pre>
  
  <p>What I'm struggling with is how to trigger the UIAlertAction programmatically. Is this possible?</p>