title: How can I get a UITableView's visible rect?
body: <p>I am trying to detect if the user has scrolled to the bottom of a UITableView so that I can do some additional stuff. In order to calculate things properly, I need to get the UITableView's visible rect. How can I achieve this?</p>
  
  <pre><code>- (void)scrollViewDidScroll:(UIScrollView *)scrollView{ 
  
      [_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView];
  
      int currentMaxPosition = CGRectGetMaxY([self.tableView visibleRect]);
      int currentMinPosition = CGRectGetMinY([self.tableView visibleRect]);
  
      int tableViewBottom = [self.tableView bounds].size.height - 100;
      int tableViewTop = 0;
  
      //get older messages once we're near the bottom
      if (currentMaxPosition &gt; tableViewBottom - 100)
      {
          NSLog(@"WE AT THE BOTTOM!");
      }      
  
  }
  </code></pre>