Trying with the simulator is here, and it seems that the frame returned when listening to the changes using the UIKeyboardWillChangeFrame is incorrect for iPhone X. In particular, the frame seems to be slightly higher than what it actually (visible) is on the screen. I would say that the returned frame is about 20 points higher.
Did I forget something obvious?
Some data ...
iPhone X and iPhone 8 have the same width in the portrait, which makes it the same height in the landscape; 375 points. ( https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions )
// iPhone X values: // keyboardChange, frame: (0.0, 375.0, 812.0, 171.0) // keyboardChange, frame: (0.0, 204.0, 812.0, 171.0) // iPhone 8 values: // keyboardChange, frame: (0.0, 375.0, 667.0, 162.0) (keyboard closed) // keyboardChange, frame: (0.0, 213.0, 667.0, 162.0) (keyboard opened)
We see that the Y value, when the keyboard is open on the iPhone X, is less, which leads us to align any of our own user interface elements higher on the screen. Those. they will not fit perfectly with the keyboard. What is my current problem, and I believe that all other applications that will do this will also suffer from this problem.
Jonny source share