title: Stop scrolling on UITableView at last during XCUI TestCase
body: <p>In my one of <code>UITableView</code> have more then 10 rows. I want to scroll till last row while <code>UITestCase</code> running.</p>
  
  <p>I have written below code to scroll till last row.</p>
  
  <pre><code>-(void)scrollToElement:(XCUIElement *)element application:(XCUIApplication *)app{
      while ([self visible:element withApplication:app]) {
          XCUIElement *searchResultTableView = app.tables[@"searchResultView"];
          XCUICoordinate *startCoord = [searchResultTableView coordinateWithNormalizedOffset:CGVectorMake(0.5, 0.5)];
          XCUICoordinate *endCoord = [startCoord coordinateWithOffset:CGVectorMake(0.0, -262)];
          [startCoord pressForDuration:0.01 thenDragToCoordinate:endCoord];
      }
  }
  -(BOOL)visible:(XCUIElement *)element withApplication:(XCUIApplication *)app{
      if (element.exists &amp;&amp; !CGRectIsEmpty(element.frame) &amp;&amp; element.isHittable) {
          return CGRectContainsRect([app.windows elementBoundByIndex:0].frame, element.frame);
      } else {
          return FALSE;
      }
  }
  </code></pre>
  
  <p>An i have called above method in my one of <code>UITestCase</code> method by below code</p>
  
  <pre><code>XCUIElement *searchResultTableView = app.tables[@"searchResultView"];
  [self waitForElementToAppear:searchResultTableView withTimeout:30];
  
  
  XCUIElement *table = [app.tables elementBoundByIndex:0];
  XCUIElement *lastCell = [table.cells elementBoundByIndex:table.cells.count - 1];
  [self scrollToElement:lastCell application:app];
  </code></pre>
  
  <p>By this code i can scroll to last row but after reaching last row, it continue doing scroll means can't stop scrolling.</p>
  
  <p>Please help me to scroll to only last row and then it should stop to scroll so that i can perform next action event.</p>
  
  <p>I have refer <code>StackOverFlow</code> answer but none of them meet my requirement.</p>
  
  <p>Thanks in advance.</p>