Dismissing the keyboard using firstResponder
-
27-09-2019 - |
문제
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?
해결책
See this answer for how to find the current first responder.
제휴하지 않습니다 StackOverflow