title: iOS 7 Storyboard Autolayout uitableviewcontroller tableviewheader parallax
body: <p>I've got trapped in some weird problem.</p>
  
  <p>I want to use <code>Autolayout</code> with <code>UITableViewController</code> along with <code>tableHeaderView</code> to stick to 
  TOP and stretch it (the table header ) just like parallax effect found in other apps.</p>
  
  <p>I know there are other solutions on the github but i am not able to find anything to this specific issue.</p>
  
  <p>What I have done is :</p>
  
  <ol>
  <li><p>Create Single View App new project (Used Version 5.1.1 (5B1008))</p></li>
  <li><p>replaced default view controller scene with <code>uitableviewcontroller</code></p></li>
  <li><p>Made the table view to have 2 or 3 static cells</p></li>
  <li><p>Added a <code>UIView</code> (with <code>UIImage</code> view in left align vertical center constrains) as a table header view</p></li>
  <li><p>added the following code to <code>viewcontroller.m</code> (inherited from <code>UITableviewController</code>)</p></li>
  </ol>
  
  <p>Code:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      headerOriginalFrame = self.myHeaderView.frame;
  }
  
  
  -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
      CGFloat offsetY = -(scrollView.contentOffset.y + scrollView.contentInset.top);
      offsetY = MAX( 0.0, offsetY );
      CGRect rect = headerOriginalFrame;
      rect.origin.y = -offsetY;
      rect.size.height = headerOriginalFrame.size.height + offsetY;
      self.myHeaderView.frame = rect;
  }
  </code></pre>
  
  <p>This does creates a parallax effect along with header view constraints.</p>
  
  <p>But the problem is that the origin point of the header view doesn't stick to tableview origin.</p>
  
  <p>It does come down as we pull the downward side.</p>
  
  <p>Also not able to see any way to add constraints to the <code>UITableViewController</code>.</p>
  
  <p>I want to do it all in the <code>UITableViewController</code> without adding other library.</p>
  
  <p>I hope there is some way to stick header to the top and get this job done.</p>