eyboard will/did hide notifications not sent on iOS 8 when interactively splitting/undocking the keyboard

Originator:adam
Number:rdar://18010127 Date Originated:13-Aug-2014
Status:Open Resolved:
Product:iOS Product Version:iOS 8.0 (12A4345d)
Classification:UI/Usability Reproducible:Always
 
Summary:
When the keyboard is undocked the app should receive a notification (via NSNotificationCenter) telling it that the keyboard is hidden. There are two notifications for this: UIKeyboardWillHideNotification and UIKeyboardDidHideNotification. In iOS 8 these two notifications are not sent when a user undocks or splits the keyboard with a gesture. Both are sent if the user long presses the hide keyboard button and choose "Undock" or "Split" from the menu that appears.

Also, sometimes the app does not receive UIKeyboardWillShowNotification or UIKeyboardDidShowNotification events when docking the keyboard interactively.

This bug causes apps to get into a bad state because they think that the keyboard is still docked.

Steps to Reproduce:
1. Build and run the attached app.
2. Tap in the text field to give it focus and make the keyboard appear. As long as the keyboard is visible and docked the label in the center will say "Shown" and the background will change to green. Whenever the keyboard is hidden or undocked/split then the label changes to "Shown" and the background is white.
3. Starting with the keyboard docked either drag the hide keyboard button (bottom right button on the keyboard) up to undock it or do a two-finger spread gesture (pull the keyboard apart horizontally) to split it. On iOS 7.1 and earlier this would cause the notification to be sent, and the app will properly update (the background color will change to white). On iOS 8 the background color remains green because the notification was not sent.
4. Starting with the keyboard docked again long-press the hide keyboard button and choose "Undock" or "Split" from the menu. In this case the notification is sent, and the background changes to white, even in iOS 8.
5. Starting with an undocked (but not split) keyboard drag the hide keyboard button to the bottom of the screen to redock it. In iOS 8 the show notifications are not sent and so the background remains white (it should be green). This case also behaves correctly if you use the long press menu to redock instead of a gesture.
6. Starting with a split keyboard either use a gesture or the long press menu to merge (but don't dock) the keyboard. In iOS 8 incorrect UIKeyboardWill/DidShowNotifications will be sent (the keyboard should be considered hidden in this case because it is undocked). The background will be green when it should be white.

Expected Results:
In every case described above the background should be green only if the keyboard is visible and docked.

Actual Results:
In some cases notifications are not sent or extra incorrect notifications are sent, causing the app to be in a bad state.

Comments

This iOS bug is causing big issues with my keyboard avoiding library

Heres a link to the issue in my library with an investigation showing that its caused by the iOS8 keyboard notifications not being sent correctly

https://github.com/IdleHandsApps/IHKeyboardAvoiding/issues/5

By idlehandsapps at Nov. 25, 2014, 8:44 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!