Case 1: When a UITextView becomefirstresponder becomeFirstResponder for the first time after cold launch,it works fine
didReceiveKeyboardWillChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardWillShowNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidShowNotification {{0, 508}, {390, 336}} 7
but notifications post twice afterwards
didReceiveKeyboardWillChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardWillShowNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidShowNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardWillChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardWillShowNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidShowNotification {{0, 508}, {390, 336}} 7
on iOS16,it works fine
2023-06-26 19:49:49.021938+0800 UITextView-demo[11835:1623447] didReceiveKeyboardWillChangeFrameNotification {{0, 508}, {390, 336}} 7
2023-06-26 19:49:49.022007+0800 UITextView-demo[11835:1623447] didReceiveKeyboardWillShowNotification {{0, 508}, {390, 336}} 7
2023-06-26 19:49:49.532870+0800 UITextView-demo[11835:1623447] didReceiveKeyboardDidChangeFrameNotification {{0, 508}, {390, 336}} 7
2023-06-26 19:49:49.535562+0800 UITextView-demo[11835:1623447] didReceiveKeyboardDidShowNotification {{0, 508}, {390, 336}} 7
Case 2: When a view is assigned to UITextView.input There are two weird behaviors:
- notifications post four times
- keyboard's height is 0 in the second notification
didReceiveKeyboardWillChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardWillShowNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidChangeFrameNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardDidShowNotification {{0, 508}, {390, 336}} 7
didReceiveKeyboardWillChangeFrameNotification {{0, 844}, {390, 0}} 7
didReceiveKeyboardWillShowNotification {{0, 844}, {390, 0}} 7
didReceiveKeyboardDidChangeFrameNotification {{0, 844}, {390, 0}} 7
didReceiveKeyboardDidShowNotification {{0, 844}, {390, 0}} 7
didReceiveKeyboardWillChangeFrameNotification {{0, 644}, {390, 200}} 7
didReceiveKeyboardWillShowNotification {{0, 644}, {390, 200}} 7
didReceiveKeyboardDidChangeFrameNotification {{0, 644}, {390, 200}} 7
didReceiveKeyboardDidShowNotification {{0, 644}, {390, 200}} 7
didReceiveKeyboardWillChangeFrameNotification {{0, 644}, {390, 200}} 7
didReceiveKeyboardWillShowNotification {{0, 644}, {390, 200}} 7
didReceiveKeyboardDidChangeFrameNotification {{0, 644}, {390, 200}} 7
didReceiveKeyboardDidShowNotification {{0, 644}, {390, 200}} 7
on iOS 16 it works fine
2023-06-26 19:41:54.991400+0800 UITextView-demo[11718:1618562] didReceiveKeyboardWillChangeFrameNotification {{0, 644}, {390, 200}} 7
2023-06-26 19:41:54.991513+0800 UITextView-demo[11718:1618562] didReceiveKeyboardWillShowNotification {{0, 644}, {390, 200}} 7
2023-06-26 19:41:54.991705+0800 UITextView-demo[11718:1618562] didReceiveKeyboardDidChangeFrameNotification {{0, 644}, {390, 200}} 7
2023-06-26 19:41:54.991928+0800 UITextView-demo[11718:1618562] didReceiveKeyboardDidShowNotification {{0, 644}, {390, 200}} 7