This example project demonstrates how to use UIKit's built-in features of scroll and table views to implement a stretchable header view for a table. The source is available in both Swift and Objective-C.
This is the companion code to an article I wrote on this topic, which you should go check out!