Autolayout instead of scrollview to handle keyboard popup

When keyboard pops up it might occlude a textfield we want to edit. One way to handle this is to use a scrollview. This can be difficult to get to work with different orientations and screen sizes however. I know it is possible, but I would like there to be a simple way to do this that anybody can implement once they get the basic idea without having to rely on magic.