Is it possible to remove the delay of UIButton's highlighted state inside a UIScrollView? Is it possible to remove the delay of UIButton's highlighted state inside a UIScrollView? ios ios

Is it possible to remove the delay of UIButton's highlighted state inside a UIScrollView?


Indeed, it's a design choice. It needs this small time to differentiate a scroll (panGesture) from a tap. If you eliminate this delay, then the user won't be able to scroll if he places the finger on top of the button, which is not good user experience.

Because a scroll view has no scroll bars, it must know whether a touch signals an intent to scroll versus an intent to track a subview in the content. To make this determination, it temporarily intercepts a touch-down event by starting a timer and, before the timer fires, seeing if the touching finger makes any movement. If the timer fires without a significant change in position, the scroll view sends tracking events to the touched subview of the content view.

from the UIScrollView Documentation

I wouldn't recommend disabling the delay, but if you insist, you can set it in interface builder (select the Scroll View, and on the right panel, right under "Bounces Zoom"), or using this code:

scrollView.delaysContentTouches = false