Search code examples
iosuiviewuigesturerecognizeruipangesturerecognizer

Pan Gesture doesnt propagate to subviews ( iOS )


I've been using the following delegate method and have properly attached the delegate ( used a break point to see that this method does indeed fire ).

func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    return true;
}

As long as GesturePanCapturingView is enabled, the table doesnt receive any gesture so that it can scroll properly. I used to have the gesture recogniser directly on the PullUpView view, there everything worked properly -however i needed to be able to scroll the whole thing even when scrolling on the imageview and therefore had to make a superview to capture it all-.

enter image description here All ideas are welcome as i'm not sure what the issue is here to begin with.

Updates

  1. I've applied the gesture recogniser to PullUpView instead and it works fine.. Does it have something to do with the fact that the Data Table component is not under GesturePanCapturingView ?
  2. I ve added a UIButton right before pullUpView. This doesnt get clicked either. Maybe its related?

Solution

  • It appears that the problem lies in not having everything under the same hierarchy. I dont very well understand this and if anyone can point me to the right direction i'd be thankful. Adding the recogniser on a superview that contains everything seems to solve the issue.