Home Simultaneous gestures across overlapping sibling views
Reply: 1

Simultaneous gestures across overlapping sibling views

jayOrange
1#
jayOrange Published in 2018-02-14 08:05:26Z

I'm having trouble accepting two gestures simultaneously across my sibling views. The view structure is as follows.

Superview
 |
 |--> ChildView1 (UITableView)
 |
 |--> ChildView2 (UIView).. Partially overlaps ChildView1

When I do a pan gesture on ChildView2, I would like that to pass through to ChildView1 so that the UITableView scrolls properly. However, when I do a LongPress gesture on ChildView2, I would like that to be properly recognized within ChildView2.

The closest question (and answer) I've seen is this. However, unlike that question, where ChildView1 has to handle the passed gesture, I would like the UITableView to handle the gesture and scroll as if it was scrolled directly on the view. Is that possible?

Thanks for any insights.

Sh_Khan
2#
Sh_Khan Reply to 2018-02-14 08:11:41Z

Create a subclass of UIView and add it as the class for childView2

class customView:UIView
{
   override func point(inside point: CGPoint,with event: UIEvent?) -> Bool
   {
     return false
   }
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.323414 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO