The Problem: When a user taps on a UIButton in a UITableViewCell, the button will only highlight on a long tap, not on a quick tap. The desired behaviour for this button to highlight regardless of the tap duration.
Unfortunately: Setting delaysContentTouches to NO on any UIScrollView or UITableView is not an option because of other undesired side effects.
So: How can I get around this - is there a way to forward touches to the button, bypassing the delaysContentTouches value?
just set delayContentTouches = false
to whatever scrollview you're using (UITableView or UICollectionView). That should do it.
As the doc says:
A Boolean value that determines whether the scroll view delays the handling of touch-down gestures. If the value of this property is true, the scroll view delays handling the touch-down gesture until it can determine if scrolling is the intent. If the value is false , the scroll view immediately calls touchesShouldBegin(_:with:in:). The default value is true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With