Im working with an UIScrollView subclass and im just trying to catch a particuliar event but i am at a loss as to how to approach it.
basically i have a horizontal uiscrollview and it has bouncing turned off. when i scroll to the either end of the scroll view it should stop dead which it does. but now i want to catch an event if the user tries swiping in the direction of the currently occupied end of content. i.e. if the user scrolls all the way to the right and tries to swipe right again how do i catch this gesture.
I have tried adding gesture recognisers to the uiscrollview subclass and when it reaches the end it turns off scrolling enabled which allows these gestures to be caught. But if the user tries to swipe in the direction that is available the scrolling effect wont happen as scrolling is turned off. i.e. when the user has scrolled to the right, then tries to scroll back to the left nothing will happen as scrolling was turned off to catch a possible gesture to the right.
Any ideas on how to catch an attempt to scroll in a particuliar direction?
Thanks
One way to catch that event is by setting the bounces to property YES and implementing the stopped bounce yourself in a scrollview subclass. By overriding the setContentOffset methods, you can replace the coordinate it scrolls to. When this happens, you can let other things happen as well.
The usage of a delegate is only a suggestion, any method call would work.