title: How do I position UITableView programmatically while using iOS7's UINavigationBar?
body: <p>I have a quite regular <code>UIViewController</code> that is a part of a <code>UINavigationController</code>-hierarchy, which naturally makes the view have a <code>UINavigationBar</code> at the top. As we all know, iOS7's navigation bars are very different from previous versions.</p>
  
  <p>If I drag a <code>UITableView</code> into my view in Storyboard, then the 'frame' for the table view is covering the entire view (I.E <code>[tableView setFrame:self.view.frame];</code>). Even behind the <code>NavigationBar</code>. 
  This makes so that if I scroll, the content will be faintly visible through the bar.
  Contrary to most people, I actually like this.</p>
  
  <p>In my current view controller, I would like to create the <code>UITableView</code> programmatically and place it as a subview here. However, I am unable to achieve the same effect this way.</p>
  
  <p>I have tried</p>
  
  <pre><code>UITableView *table = [[UITableView alloc] initWithFrame:self.view.frame];
  [self.view addSubview: table];
  </code></pre>
  
  <p>This makes the 'top scrolling point' stay behind the navigation bar. Imagine a single cell in a tableView, and it's faintly visible through the top bar. If I scroll down, it pops right up behind it. That's the default 'top position'.</p>
  
  <p>I have also tried</p>
  
  <pre><code>CGRect frame = CGRectMake(0, 'nav.y+nav.height', self...width, self...height-y);    
  UITableView *table = [[UITableView alloc] initWithFrame:frame];
  [self.view addSubview: table];
  </code></pre>
  
  <p>to simply place the table view in the rect below the <code>UINavigationBar</code>, but then I won't get the scrolling transparency effect behind the bar.</p>
  
  <p>I also tried the first example along with this:</p>
  
  <pre><code>[tableView setContentOffset:CGPointMake(0, 'below navbar')];
  </code></pre>
  
  <p>which makes it stay exactly where I want it to stay, but as soon as I touch it (scroll and release), it scrolls back up behind the navigation bar, and stays there.</p>
  
  <p>What's the programmatic solution to achieve this effect? Do I have to set the offset every time I scroll too far up, or is there a simpler solution? Along with this iOS7-style, I'd imagine they would add something like <code>[tableView setVisibleFrame:]</code> or something..? </p>