Trying with simulator here, and it seems that the frame returned when listening for changes with UIKeyboardWillChangeFrame
is incorrect for iPhone X. Specifically the frame seems to be a bit taller than it actually is (visibly) on screen. I'd say the returned frame is about 20 points taller.
Did I forget something obvious?
Some data...
The iPhone X and iPhone 8 have the same width in portrait, which makes it the same height in 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 can see that the Y value when keyboard is opened on the iPhone X is smaller, which leads us to align any of our own UI elements higher on screen. Ie they will not align perfectly on top of the keyboard. Which is my current problem, and I assume all other apps doing that will also suffer from this problem.