views:

527

answers:

1

When the user touches into an UIScrollView and wants to scroll, there is a little delay. UIKit tries to find out if the user wanted to touch the content in the scroll view or if the user wanted to scroll. So it waits a moment if the finger moves far enough, and then starts scrolling. Could I tell it that it must start scrolling with no delay? I have a situation where the content really doesn't care at all about touches, so the UIScrollView doesn't have to wait, it can immediately start scrolling.

+1  A: 

I think you're looking for the delaysContentTouches property on UIScrollView. Setting that to NO should cause the UIScrollView to immediately start processing touch events.

Brad Larson
Thanks Brad, that sounds good. I tried it, but unfortunately I still discover a delay when I start dragging slowly. When dragging fast from the beginning, there's no lag. But when you drag slowly, you notice a delay of approx. 0.15 seconds. I couldn't figure out a big difference by setting delaysContentTouches to NO or to YES. I tried that in a blank new project with nothing else around than a UIScrollView and a colored UIView subview.
HelloMoon
You could also try subclassing UIScrollView and override -touchesShouldBegin:withEvent:inContentView: to have it return NO. That should prevent the scroll view from sending any touch events to subviews and may also remove the delay you're experiencing.
Brad Larson