title: How to make Navigation Bar like Instagram
body: <p>I need to implement something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Sg6gH.png" alt="NavBar stay on top, tableView bounces"></p>
  
  <p><strong>tableView must bounce, but not navigation bar.</strong></p>
  
  <p>I tried a bunch of different variants.
  Something like this:</p>
  
  <pre><code>- (void)scrollViewDidScroll:(UIScrollView *)scrollView
  {
      CGRect imageViewFrame = self.imageView.frame;
      CGRect tableViewFrame = self.tableView.frame;
      //ImageView - is top view(instead of NavBar)
      //defaultHeight - is default height of tableView
      imageViewFrame.origin.y = MIN(0, MAX(-scrollView.contentOffset.y, -100));
      tableViewFrame.origin.y = imageViewFrame.origin.y + 100;
      tableViewFrame.size.height = defaultHeight - imageViewFrame.origin.y;
  
      self.imageView.frame = imageViewFrame;
      self.tableView.frame = tableViewFrame;
  }
  </code></pre>
  
  <p>Get this:</p>
  
  <p><img src="https://i.stack.imgur.com/uwc7o.png" alt="1">
  <img src="https://i.stack.imgur.com/jdcLN.png" alt="2"></p>
  
  <p>it is not suitable because in Instagram size of tableView doesn't change(just look at scroll indicators, if size of tableView changed, they also changed)</p>
  
  <p><img src="https://i.stack.imgur.com/BEybu.png" alt="please look at scroll indicators">
  <img src="https://i.stack.imgur.com/c3j77.png" alt="please look at scroll indicators"></p>
  
  <p>Also I tried add View as subView into tableView, it works, but not exactly what I need is.
  In Instagram navigation bar outside the tableView, so it is not suitable too.</p>
  
  <p>In the facebook app search bar behaves exactly the same</p>
  
  <p><img src="https://i.stack.imgur.com/M9Tgb.jpg" alt="enter image description here"></p>
  
  <p>Can anyone help me?</p>
  
  <p>Thanks!</p>