I have the issue in two completely different situations, which makes it really weird.
In both situations the buttons's are only highlighted after a slight delay, approximately .5 - 1 second. Definitely to long to highlight the view when tapping it normally. They both work perfectly on the simulator, but not on a real device (I have an iPhone 5s with iOS 7.0.4).
What I tried
Setting the zPosition to the highest value (MAXFLOAT) of these views, to ensure nothing is blocking the tap.
Explicitly enabling the highlighting.
Both obviously doesn't worked.
Edit: Still not solved.
This can happen if the buttons are placed close to the bottom edge of the display. There's a conflict with the system edge gesture to present Control Center (or App Switcher on iPhone X and iPad). It delays touches for your buttons until it's determined the user isn't performing a system gesture.
If you would like, you can tell the system to give precedence to your gestures over the system gestures.
override func preferredScreenEdgesDeferringSystemGestures() -> UIRectEdge {
return .bottom
}
Do note however that this will require the user swipe twice to activate the system gesture.
Are the UIButtons inside a UIScrollView ? If they are, the delay is there so the scrollview can determine whether the touch is for scrolling or it should be passed on to the subview.
See also UIButton touch is delayed when in UIScrollView
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