0

In my custom container view controller I need to hide the keyboard when some things occur.

Because I don't know who the first responder is I just force close it as follows:

for (UIViewController *child in self.childViewControllers) {
        [child.view endEditing:YES];
}
[self.view endEditing:YES];

The keyboard hides - which is great - but when I tap on a different text field - the previous text field which was the first responder before calling endEditing still gets the keyboards input.

Am I missing something here? Shouldn't it have resigned its first responder status? shouldn't the text field that was tapped get to be the first responder?

Avba
  • 14,822
  • 20
  • 92
  • 192

1 Answers1

0

I think you should resignFirstResponder for that view .

Macrosoft-Dev
  • 2,195
  • 1
  • 12
  • 15