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
Another approach is to just compare if the view of the touch is the gestures view, because descendants won't pass the condition. A nice, simple one-liner:
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
return touch.view == gestureRecognizer.view
}