title: Load more cells when user scrolls to bottom of tableview frame
body: <p>I am adding new data to a <code>tableView</code> when the user scrolls to bottom like this....</p>
  
  <pre><code>- (void)scrollViewDidScroll:(UIScrollView *)aScrollView {
          float  height = self.itemListTableView.frame.size.height;
          float contentYoffset = aScrollView.contentOffset.y;
          float distanceFromBottom = aScrollView.contentSize.height - contentYoffset;
          if (distanceFromBottom &lt; height) {
          NSLog(@" you reached end of the table");
          isTableScrolledToBottom = YES;
     }else{
          isTableScrolledToBottom = NO;
      }
  }
  
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
      static NSString *CellIdentifier = @"CellIdentifier";
      ListViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
    if(cell==nil){
        cell = [[ListViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
         //Assign values to labels here..
  
      if (isTableScrolledToBottom) {
  
          if (indexPath.row == [apiMutableArray count]-1)
          {
              // Call the API
              NSLog(@"Call the api");
              int pgn = [self.currentPageNumber intValue];
              pgn = pgn+1;
              self.currentPageNumber = [NSNumber numberWithInt:pgn];
              NSLog(@"incremented page number : %@",self.currentPageNumber);
              NSMutableDictionary *mutableDict = [self.poPostDict mutableCopy];
              [mutableDict setObject:self.currentPageNumber forKey:@"pageno"];
              self.poPostDict = [mutableDict mutableCopy];
  
              [self addLoaderViewAtBottom];
              [self loadPOData:self.poPostDict]; 
          }
      }
   return cell;
  }
  </code></pre>
  
  <p>Now if the data in table view is big enough, the user will scroll to bottom and data fetching is done from api as expected.However when I filter this table and lets say I get only one row of data.
  In such case even if I can see only one cell is present in the table, if I try to scroll the table, the api request is hit.
  How to actually know if user has scrolled beyond its <code>frame</code> and upto <code>scrollView's</code> end so that only in that case I can fetch the data.</p>
  
  <p>Note:- Using current technique if only one row is present and I try to scroll, the api call is hit continuously without stopping.</p>