In view A, I have a text field. I tap a control to push in a new view controller B. View B only has a text view whose frame should be adjusted to accommodate the keyboard, and I always set the text view to be the first responder and the keyboard should show immediately when view B is pushed in.
I do the usual keyboard notification handling in view controller B. So if the keyboard is not shown before view B is pushed, there is no problem. However, if the text field in view A is the first responder and the keyboard is already shown when I push in view controller B, I won’t receive UIKeyboardWillShowNotification/UIKeyboardDidShowNotification. Any suggestion to handle this situation?
To resign first responder then become first responder again is not a good solution that I dropped immediately the first time I thought about it. Forcing the keyboard to hide and show up again immediately when the keyboard is already there is just not the right thing to do — it is a waste and breaks the smooth transition.
Sending keyboard status from view A to view B by breaking the encapsulation of B is neither an acceptable thing to do in software engineering.
So I believe it deserves a bug report and I did one — #11205521.