How to detect that UIScrollView is scrolling or that is is dragging

I need to know on a continuous basis when my UIScrollView is scrolling or dragging.

Answers


Implement these two delegate methods..

- (void)scrollViewDidScroll:(UIScrollView *)sender{
  //executes when you scroll the scrollView
}

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
 // execute when you drag the scrollView
}

Better use isTracking

func scrollViewDidScroll(_ scrollView: UIScrollView) {

    if scrollView.isTracking {   
    // ... 
    }
}

Alternative to @Shorhashi's solution:

- (void)scrollViewDidScroll:(UIScrollView *)sender{
    if(sender.isDragging) {
        //is dragging
    }
    else {
        //is just scrolling
    } 
}

Need Your Help

Disable links till all animations stop and enable them again

javascript jquery css3

I have an image slider like animation, the differences is that in one slide are several elements, in my case 4 pictures which come from the left or right side in the scene.

LoopbackJS: HasAndBelongsToMany, how to query/filter by property of relation?

angularjs node.js loopbackjs strongloop

I'm currently working on my first Loopbackjs project and am facing a seemingly simple issue: