title: Correct (App Store Safe) way to resign a first responder?
body: <p>What's the correct way to resign the current firstResponder?  </p>
  
  <p>I've seen the following:
  Looping through fields and calling resignFirstResponder on each.</p>
  
  <pre><code>[[self textFieldForRow:0] resignFirstResponder];
  [[self textFieldForRow:1] resignFirstResponder];
  [[self textFieldForRow:2] resignFirstResponder];
  [[self textFieldForRow:3] resignFirstResponder];
  </code></pre>
  
  <p>And this which looks like it's calling a private function, is this app store safe?:</p>
  
  <pre><code>UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
  UIView   *firstResponder = [keyWindow performSelector:@selector(firstResponder)];   
  [firstResponder resignFirstResponder];      
  </code></pre>
  
  <p>Is there a better way? </p>
  
  <p>Thanks!</p>
  
  <p>Comments:
  Looks like the second method is using a private api and someone's app has been rejected because of it: <a href="https://stackoverflow.com/questions/1823317/how-do-i-legally-get-the-current-first-responder-on-the-screen-on-an-iphone">link</a></p>