UIScroll View Delegate not calling ScrollViewDidEndScrollingAnimation
Asked Answered
A

5

36

I have implemented the UIScrollViewDelegate protocol in my .h file and i have implemented the

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView

method in my .m class. when the scrolling is done in my table view other delegate method of scrollview are getting called, but when scrolling ends, -scrollViewDidEndScrollingAnimation: is not getting called. I am bit stuck in this.

Thanks and regards

Acetophenetidin answered 28/12, 2009 at 12:27 Comment(0)
S
113

-scrollViewDidEndScrollingAnimation: is called when a programmatic-generated scroll finishes.
-scrollViewDidEndDecelerating: is called when a user-swipe scroll finishes.

Sudoriferous answered 5/2, 2011 at 21:0 Comment(2)
+1 and thank you for explaining the difference between the two delegate methods. I think this should be the accepted answer!Haslam
And if you also want to react on when a user drags the scroll view, but releases it without the scroll view scrolling further, you should also implement the scrollViewDidEndDragging method, you can check the bool parameter willDecelerate to decide on whether you have to execute the code here or in the scrollViewDidEndDecelerating method.Anagram
F
2

I had the same problem ... Try using scrollViewDidEndDecelerating instead.

Fardel answered 25/5, 2010 at 11:34 Comment(0)
S
2

Had the same problem. Have used the following in my delegate class:

#pragma mark -
#pragma mark UIScrollViewDelegate
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {

    NSLog(@"lol");
}

works like a charm!

Schock answered 3/8, 2010 at 14:20 Comment(1)
Thanks big help. Have you filed a bug report about this? I've just submitted rdar://8810881 openradar.appspot.com/8810881.Sweetbread
J
1

I had the same problem and the issue was i did not include the delegate code:

self.myScrollView.delegate=self;

Hope this helps someone as well.

Jordanson answered 15/2, 2011 at 10:8 Comment(0)
E
0

Swift?

func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {

}
Enclitic answered 3/9, 2017 at 13:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.