title: Detect UITextField Lost Focus
body: <p>i searched a lot googling and heree, but nothing useful.</p>
  
  <p>I have two textfields and i don't able to recognize which one lost the focus.<br>
  I tried all options, but nothing.</p>
  
  <p>Here the <code>textFieldDidEndEditing</code>:</p>
  
  <pre><code>- (void) textFieldDidEndEditing:(UITextField *)textField {  
    NSLog(@"%@", [textField state]);
    NSLog(@"%d", [textField isSelected]);
    NSLog(@"%d", [textField isFirstResponder]);
    NSLog(@"%d", [textField isHighlighted]);
    NSLog(@"%d", [textField isTouchInside]);
  
    if ( ![textField isFirstResponder] || ![textField isSelected] ) {
    //if ( [textField state] != UIControlStateSelected) {
      NSLog(@"not selected!");
      [...]
      // remove view / etc...
    }
  }
  </code></pre>
  
  <p>All NSLog returns 0! Why?!?</p>
  
  <p>How can i detect lost focus? This method has called every time that i press a keyboard button, non only at the end!<br>
  Is there any alternatives?</p>
  
  <p><strong>EDIT</strong>:<br>
  I don't want to switch from texts but i want to detect lost focus when i click anyways on screen. (the keyboard will dismiss or not and the caret is not present on textfield)!</p>
  
  <p>thanks.</p>