title: Forcing footer to stay under last cell in tableview
body: <p>I have a tableview with custom cells. What I want is to have a footer (like a "loading" indicator") at the bottom of the tableview. I am using this code to add the footer:</p>
  
  <pre><code>- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
      UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
      [spinner startAnimating];
      spinner.frame = CGRectMake(0, 0, 320, 44);
  
      return spinner;
  }
  </code></pre>
  
  <p>But this makes the footer "float" over the bottom of the tableview and overlaps the bottom of the table:</p>
  
  <p><img src="https://i.stack.imgur.com/DVmD0.png" alt="enter image description here"></p>
  
  <p>How can I force the footer to only be visible <strong>under the last cell of the table</strong>? Like this:</p>
  
  <p><img src="https://i.stack.imgur.com/o04aA.png" alt="enter image description here"></p>
  
  <p>Thanks!</p>