Reputation: 15266
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?
Upvotes: 3
Views: 2527
Reputation: 517
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
Upvotes: 2
Reputation: 1083
Instead of using isDragging
use isTracking
for touch recognising on UITableView
.
Or
if you want to recognize dragging ofUITableview
use scrollview delegate methods.
Upvotes: 9
Reputation: 368
Try using uiscrollView Delegate. You will get call here when user is panning
– scrollViewDidScroll:
Upvotes: -1