All.
In my iOS 8.0 app.
In a Parent Child View architecture. By this code...
[self addChildViewController:slideTableViewController];
[self.view addSubview:slideTableViewController.view];
[slideTableViewController didMoveToParentViewController:self];
I have implemented TapGesturerecognizer & PanGesturerecognizer on Base View Controller.
So, that it can recognise Pan(Dragging) and Tap. I need both gestures on my BaseView.
Just do not want Tap Gesture on SlideView
.
As I want to execute didSelectRowAtIndexpath method on child view,
Solution:
Answer for Question 1: Many StackOverflow answers have the same funda.. Disable Tap gesture when your touch encounters child view.
if([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]){
if(CGRectContainsPoint(slideTableViewController.view.frame,[touch locationInView:self.view])){
return NO;
}
}
Answer for Question 2:
How to determine Is it a PanGesture or TapGesture ?
For each gesture type the delegate method will call
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
If you have implemented two gestures in your view, pan gesture and touch gesture,
This method will call 2 times, 1 time for pan gesture and 1 time for tap gesture.
So, in this method you can check like isKindOfClass
method.
Thank you very much for helping......
gesture.enabled = NO
– BanningsuserInterationEnabled
property. – user4657588[gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]
– Bannings