3

I want to know if a UIScrollView (UITableView) is dragging (panning) because the user's finger is actively panning it (the user's finger is on the scrollview . i.e. on the screen) or because the scroll view was "flicked" and it is scrolling (i.e 'decelerating' per UIScrollView default behavior)

I tried checking for

[self.tableView isDragging]

and unfortunately this returns 'YES' in both cases

Then how can I decide if the user's finger is on the 'screen' - and panning?

Avba
  • 14,822
  • 20
  • 92
  • 192

3 Answers3

9

Instead of using isDragging use isTracking for touch recognising on UITableView.

Or

if you want to recognize dragging ofUITableview use scrollview delegate methods.

Thukaram
  • 1,085
  • 2
  • 13
  • 33
2

Using your scroll view delegate you are achieve this.

 - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;
 - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView;   
// called on finger up as we are moving

 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; here
Jack Patoliya
  • 507
  • 6
  • 14
-1

Try using uiscrollView Delegate. You will get call here when user is panning

– scrollViewDidScroll:
Azerue
  • 258
  • 6
  • 16