I need to implement a feature that will invoke some code when I double tap on the self.view (view of UIViewCotroller
). But the problem that I have other UI obje
I had to prevent the gesture on the child view. The only thing that worked is to allow and keep the first view and prevent gesture in all the next views:
var gestureView: UIView? = nil
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
if (gestureView == nil || gestureView == touch.view){
gestureView = touch.view
return true
}
return false
}