I am subclassing a UIViewController and instantiating a UIScrollView in it’s view which has a height of 480 and a width of 640 (2x the regular width). Paging is enabled, so it’s essentially 2 views side by side that you can see either of by swiping back and fourth. My end goal is to have my view controller notified whenever the user swipes to switch sides. I am trying to use the UIScrollViewDelegate method scrollViewDidEndScrollingAnimations:scrollView, but it’s not getting called. I have the delegate set to the view controller correctly, because the other delegate method scrollViewDidScroll:scrollView, gets called many times during a single scroll. Any ideas as to how I can fix this / accomplish what I’d like?
I am subclassing a UIViewController and instantiating a UIScrollView in it’s view which has
Share
The problem is that the
scrollViewDidEndScrollingAnimation: delegate method is not called when a swipe to a new page is completed. You’ll get multiplescrollViewDidScroll: calls while it’s actually moving to the new page, and then once it completes, it will send thescrollViewDidEndDecelerating: call that pachun mentions in another answer.The
scrollViewDidEndScrollingAnimation: method is only called when the scrollview animates a motion after the methodssetContentOffset:animated:andscrollRectToVisible:animated:are used. It doesn’t get called based on just user touches moving the scrollview (http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html).