I have a UIScrollView
which is able to contains many view. To allow a good scrolling (without the content going outside the view while scrolling), on my Main.sotryboard
, I've clicked on my UIScrollView
and then in the attribute inspector I have allowed the Clip Subviews
property:
My problem: all the views which are in my UIScrollViews
are draggable (because they all have a UIPanGestureRecognizer
.
So, when I try to drag them OUTSIDE my UIScrollView
, they just disappear.
In fact they're just going behind every other view
To give you an exemple, I have others components which allow the drop of a view form the precedent UIScrollView
. So when I begin the drag'n'drop from it, it disappear, and then reappear in the second component on which I have dropped the view.
What I have tried: I have a special UIPanGestureRecognizer
for te drag'n'drop of a view coming from this UIScrollView
. So, I actually have this (which, obviously, doesn't work, otherwise I would not be here):
//Here recognizer is the `UIPanGestureRecognizer`
//selectpostit is the name of the view I want to drag
if(recognizer.state == UIGestureRecognizerStateBegan){
selectpostit.clipsToBounds = NO;
}
Any Ideas on how I can improve that? Thanks in advance.