Sample project for my blog post, Smoothly reacting to keyboard visibility changes.
The implementation for detecting keyboard visibility and animating size change can be found in FluidContentResizer and its usage here. It's a tiny project so feel free to simply copy over the necessary files to your project.
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. Full license can be read here: https://raw.githubusercontent.com/saket/FluidKeyboardResize/master/LICENSE