title: How to implement the scroll process of tableheaderview?
body: <p>When I add some hidden header view, like search bar, to the table view, it scrolls automatically to content's top or table cell's top, when I set the offset of the scroll to the middle of a search bar. (I used below code)</p>
  
  <pre><code>// in viewDidLoad section
  UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]
  [self.tableView setTableHeaderView:searchBar]
  
  // in viewWillAppear: section
  [self.tableView setContentOffset:CGPointMake(0, 44)];
  </code></pre>
  
  <p>For example, if I scroll up a little amount when the search bar is hidden, it automatically scrolls to display the entire search bar.
  And if I scroll down a little when the search bar is displayed, it automatically scrolls to make the search bar hidden.</p>
  
  <p>I used below code to implement this feature to my collection view's header, but that wasn't exactly the same as the table view's feature.</p>
  
  <pre><code>- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
  {
      CGFloat offset = scrollView.contentOffset.y;
      if (offset &gt; 22 &amp;&amp; offset &lt; 44) {
          [scrollView setContentOffset:CGPointMake(0, 44) animated:YES];
      } else if (offset &gt; 44) {
          return;
      } else {
          [scrollView setContentOffset:CGPointMake(0, 0) animated:YES];
      }
  }
  </code></pre>
  
  <p>I think it is very hard to mimic above feature exactly, because the judgment of displaying the entire search bar or hiding the search bar is very subtle.</p>
  
  <p>So my question is, "Is there any pre-implemented method in iOS SDK, or in UICollectionViewController?".</p>
  
  <p>I googled for many hours but I couldn't found the answer.</p>