I need to get contentOffset
values for a UIScrollView
(UICollectionView
to be more exact) that are sampled at a very high frequency in order to transform a layer based on the contentOffset
of that scrollview. I find that the sampling rate for in scrollViewDidScroll
isn't fast enough to pickup contentOffset
differences small enough perform smooth transformations when I swipe quickly. Is there a way to look for smaller differences or am I approaching this problem entirely wrong?
Asked
Active
Viewed 1,505 times
8
-
5There isn't anything faster than that. That delegate method gets called *every* time the content offset of the scroll view changes, so there wouldn't be a point in sampling it any faster than that. – Mick MacCallum Apr 10 '14 at 00:49
-
I see, I wonder how other people tie view transformations to scrolling. Is it possible that looking directly at the gesture recognizer might lead to better results? – coolio Apr 10 '14 at 01:28
-
does this help? http://stackoverflow.com/a/13404171/1835155 – jbouaziz Apr 10 '14 at 01:47
-
Your best bet is to use the `scrollViewDidScroll` method and create a way to smooth your animation between each call. Think of anti-aliasing where the processor fills in the gaps between pixels to give the effect that the image is smoother than it is. – Chris Apr 10 '14 at 02:13
-
1Do it like an interactive custom transition animation: set the layer's `speed` to 0, attach an animation, and keep setting the layer's `timeOffset`, as I describe here: http://stackoverflow.com/a/22677298/341994 – matt Apr 10 '14 at 02:19
-
Thanks so much for the suggestions. I will try them out and see what works best. – coolio Apr 10 '14 at 18:29
-
you can have look at [this answer](https://stackoverflow.com/questions/39482753/scrollviewdidscroll-does-not-catch-movement-continuously) – Anirudha Mahale Jul 23 '17 at 14:53
1 Answers
0
You can try using the scrollview Delegate methods.
scrollViewWillBeginDragging() can solve you purpose.
The necessary documentation can be found here

Bin0li
- 168
- 16