Search code examples
iosobjective-cuiscrollviewuigesturerecognizeruitouch

UIScrollView isDragging returns YES when no scrollview is decelerating


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?


Solution

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

    Or

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