The keyboard represents a layout challenge which is even more challenging when autolayout is in use. This sample project shows how it can be managed easily with a base class and a view hierarchy which can be applied in multiple scenarios.
Below is a video which covers how the code works and how the view hierarchy would be assembled in a storyboard.
YouTube Overview: http://youtu.be/5BR7Xt6a6ew