1

To dismiss the keyboard I use either one of the following:

[sender dismissFirstResponder]
[self dismissFirstResponder]

The problem is, I have a situation where the user selects a text field, and some other text field is the first responder with the keyboard showing. I want to dismiss the keyboard when this particular text field is selected. So neither of these will work to dismiss the keyboard.

How can I dismiss the keyboard if I don't know who is the first responder?

node ninja
  • 31,796
  • 59
  • 166
  • 254

1 Answers1

3

See this answer for how to find the current first responder.

Community
  • 1
  • 1
Daniel Dickison
  • 21,832
  • 13
  • 69
  • 89