I use below code to get keyboard height. Then use this height to calculate the frame of an UIView to make sure this UIView just on the top of the k
UIView
I also faced this problem. What I did, simply I check keyboard that is different on iPhone 7 and iPhone X. I just add some default margin with keyboard height. Now It is working fine on every device.