I'm trying to create a teleprompter. Basically auto scrolling scrollView.
I'm moving my scrollView.contentOffset.y by 1 point/pixel every X time.
I'm giving the user the option to slow the animation down, and I want to do it by moving fewer points, not by increasing the time it takes to call for each pixel movement.
But I can't reduce the point size to less than 0.3333. When calling for a movement of 0.2 it's rounded up to 0.333, 0.1 is rounded down to 0 so I'm getting 0 movement. Why is that and how can I change it?
The offset is in points. On a 3x device, a single pixel is 0.3333 points. Obviously you can't scroll a partial pixel.
One solution that effectively gets around this issue is for you to keep your own value for the offset that you can increment in smaller values. Then update the scroll view's offset with your own running value. Don't try to add something like 0.1 or 0.2 to the scroll view's offset. Increment your own value and update the scroll view's offset. Of course the actual movement of the scroll view won't be as fined grained as your little updates but the overall scrolling will be slower.