title: UIAlertController with text field - hitting return button only hides keyboard, does not perform action?
body: <p>I'm trying to use the iOS 8 <code>UIAlertController</code> in place of where I would have used a <code>UIAlertView</code> in the past. I want the user to be able to enter text into this alert and hit "OK" to process the text or "Cancel" to cancel.</p>
  
  <p>Here's the basic code:</p>
  
  <pre><code>UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Change Value" message:@"Enter your new value."];
  [alert addTextFieldWithConfigurationHandler:nil];
  
  [alert addAction: [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
      UITextField *textField = alert.textFields[0];
      NSLog(@"text was %@", textField.text);
  }]];
  
  [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
      NSLog(@"Cancel pressed");
  }]];
  
  [presentingVC presentViewController:alert animated:YES completion:nil];
  </code></pre>
  
  <p>With the old <code>UIAlertView</code>, I would tag it with an <code>alertViewStyle</code> of <code>UIAlertViewStylePlainTextInput</code>. Then, if the user hit the "Return" button on their keyboard after entering text, the UIAlertViewDelegate method <code>willDismissWithButtonIndex:</code> would be called with some <code>buttonIndex</code> (depending on what buttons had been specified in the <code>UIAlertView</code>).</p>
  
  <p>In the new <code>UIAlertController</code>, if the user taps the "OK" or "Cancel" buttons, then their corresponding actions are performed as expected; but if the user just hits the "Return" key on the keyboard, it just hides the keyboard, but the alert remains on screen and no action is performed. </p>
  
  <p>I've thought about configuring the text field to set the <code>UITextFieldDelegate</code> to <code>self</code>, and then maybe overriding the <code>textFieldDidReturn:</code> method, but I also don't know if there's a way to call one of the <code>UIAlertController</code>'s actions programmatically. And this is sounding sort of messy/hacky anyway. Am I missing something obvious?</p>