I have a layout with a UIView
at the top of the page and, right below it, I have a UITableView
.
What I am wanting to do is to transfer the gesture interactions on the UIView
to the UITableView
, so when the user makes a drag up/down on the UIView
, the UITableView
scrolls vertically.
I tried the following code
tableView.gestureRecognizers?.forEach { uiView.addGestureRecognizer($0) }
but it removed the gestureRecognizers from the UITableView
somehow :/
Obs.: the UIView
cannot be a Header
of the UIScrollView
That's Tricky
What is problem ?
What would be possible solutions
Second option is better and easy.
So What you need to do is create subclass of
UIView
andoverride
and return nil if you found same view on
hitTest
actionHere Tested and working example
That's it now use
PassThroughME
either by adding class to your view in storyboard or programmatically whatever way you have added your viewCheck image i have black color view with 0.7 alpha on top still i am able to scroll
Hope it is helpful