문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top