I\'m using UIGestureRecognizer in my iOS application and I\'m having some issues.
I only want the gestures to work in a certain area of the view, so I made a new UIView
Yo can also do:
gestureRecognizer.delegate = self
somewhere. generally on viewDidLoad(). then you implement the method:
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
let view = self.getTheViewDontWannaConsider() /* or whateva */
let point = touch.location(in:view)
if point.y >= 50 /* or whateva calc. you want */ {
return false
}
return true
}