title: How to collapse UITableView header as you scroll
body: <p>The functionality I am trying to achieve is shown in Twitter <a href="https://michiganlabs.com/assets/images/posts/twitter_demo.cb5f0966.gif" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I have been looking at several resources online including this <a href="https://michiganlabs.com/ios/development/2016/05/31/ios-animating-uitableview-header/" rel="nofollow noreferrer">article</a> by Michigan Labs which is very useful in getting the collapsing animation by using constraints on a header view that is above the <code>UITableView</code></p>
  
  <p>The problem I see with this approach is that since it is not technically part of the <code>UITableView</code>, the header will not be responding to Up/Down scroll gestures. However, when I download the Twitter app, the header does respond to touch. How do I make the header sensitive to touch gestures as well?</p>
  
  <p>Summary: I want to duplicate that middle section where it shows the profile picture, followers, buttons, and segmented control that collapses until only the segmented control is showing.</p>