简体   繁体   中英

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-.

在此处输入图片说明 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM