I have a UIView
on some part of screen. This UIView has Pan gesture recognizer. This UIView ( mainVw) has a UITextView
that completely covers the UIView. This UITextview has swipe gestures(left and write).
My problem is When I swipe left or right, The UIView starts dragging also. What I want is ,when I drag the UIView it should drag and when I swipe UITextView should swipe left write but no dragging.
Here is the code I'm using to give better understanding:
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
[panGesture setMinimumNumberOfTouches:1];
panGesture.delegate =(id)self;
[self.mainVw addGestureRecognizer:panGesture];
//[self.mainVw.layer setValue:[NSValue valueWithCGPoint:vwCaptionBg.center] forKey:@"originalCenter"];
UISwipeGestureRecognizer *rightRecognizer;
rightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanTouch:)];
[rightRecognizer setDirection: UISwipeGestureRecognizerDirectionRight];
rightRecognizer.delegate=(id)self;
[self.txtVw addGestureRecognizer:rightRecognizer];
UISwipeGestureRecognizer *vwLeftRecognizer;
vwLeftRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanTouch:)];
[vwLeftRecognizer setDirection: UISwipeGestureRecognizerDirectionLeft];
vwLeftRecognizer.delegate=(id)self;
[self.txtVw addGestureRecognizer:vwLeftRecognizer];