title: iOS:Extra space at the bottom of UITableView
body: <p>I have created <code>UITableView</code> programmatically, but it has some extra space below (29 pixels to be precise). </p>
  
  <p>This is how I initialize the table: </p>
  
  <pre><code>UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  [tableView setTranslatesAutoresizingMaskIntoConstraints:NO];
  [self.contentView addSubview:tableView];
  self.alertsTableView = tableView;
  </code></pre>
  
  <p>Here are the constraints: </p>
  
  <pre><code>    @"V:|-10-[_alertsTableView(0)]-5-[_optionsLabel]",
      @"H:|-15-[_alertsTableView]-15-|", 
  </code></pre>
  
  <p>I tried setting the footer view to nil and returning zero for its height: </p>
  
  <pre><code>[self.tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
  
  -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
      return CGFLOAT_MIN;
  }
  </code></pre>
  
  <p>I dynamically change its height, based on the content: </p>
  
  <pre><code>- (void)updateHeight:(CGFloat)height {
      if (self.tableView.superview) {
          NSLayoutConstraint *heightConstraint;
          for (NSLayoutConstraint *constraint in self.tableView.superview.constraints) {
              if (constraint.firstAttribute == NSLayoutAttributeHeight) {
                  heightConstraint = constraint;
                  break;
              }
          }
          heightConstraint.constant = height;
      }
  }
  </code></pre>
  
  <p>I also set <code>setAutomaticallyAdjustsScrollViewInsets</code> to <code>NO</code>. And <a href="http://i.stack.imgur.com/vdy9C.png" rel="nofollow">this</a> is the end result. There is a separator between the cell and the empty space, but the bottom is not a cell. </p>