I'm familiar with how to get the actual keyboard height via notifications when the keyboard appears, disappears or changes. However I want to have a chat view at the bottom of the screen and some buttons above it. These buttons should be as low as possible (for usability reasons) but should never have to move to not be covered by the keyboard and the chat text field.
In other words, there should be an invisible line at the height where the tallest keyboard's height + the text input's height would come, and the buttons should be aligned with their bottoms to that line.
The challenge is that people use different keyboards having different heights depending on language, device, iOS version and settings. I could add some magic constants and hope things don't change too much between iOS versions but I would rather poll the OS in some kind of way to give me that information instead, so everything just updates automatically between iPhone X, iPhone SE, iPads landscape portrait etcetera.
How can I reserve just enough space for the keyboard before it's actually shown?