-
Notifications
You must be signed in to change notification settings - Fork 661
development branch: tap recognizer breaks uitableview cell selection in frontview #76
Comments
Mhm I thought I had that tested. Please do submit the request. I can't promise I'll merge it right away but I'll definitely be a great help! |
Did some more testing and have a similar problem with the pan gesture recognizer and a tableview with editable cells (i.e. UIPanGestureRecognizer vs. UISwipeGestureRecognizer). The pan gesture recognizer steals all the touches. Still trying to figure out how Facebook solved the issue in their table view (cell with photo scroll view for instance). |
The way to achieve that is to create a hierarchy between recognizers by using the However since depends so much on the function and structure of the contained view, it might be the best approach to not automatically add the swipe recognizer while setting up the pane controller but to make it available so that the user can customize it and attach it to any desired view. |
You mean not automatically add the pan recognizer to my containers? (Seeing how the swipe recognizer for the tableviewcell's edit modes sits on each tableview…). Fair enough - guess that could be another option key users could pass. I'd have to expose the recognition method but other than that it seems reasonable. Closed by accident. Reopened. |
I guess the most flexible solution would be to expose the correctly initialized swipe recognizer as property so that users can attach it to any control as their UI requires (and/or configure recognizer hierarchy). The default setup could stay as it is. |
Did the aforementioned modifications, but I guess it'll be inevitable to have people stumble upon that issue not knowing how to resolve it themselves. Will have to think of something,... - If you have any more ideas, I'm thankful for input :) |
There's a very simple and clean way to resolve this problem. PKRevealGesture should implement the Gesture delegate method : |
I came to this issue after reading the FAQ and found this to be a better way Why not just add at the top of gestureRecognizerShouldBegin: CGPoint touchPosition = [gestureRecognizer locationInView:self.view]; This solved the problem for me at least! Added the change as pull request.. |
Hi, I solved the issue as explained in the FAQ, but I also wanted to have the "show left menu" gesture active. So I did the following: In the frontViewController: viewDidLoad
-(void)showLeftMenu{ Hope you find it useful |
@vergaramikel great solution, it is the only one which actually works for me. Did you implement even hideLeftMenu to hide menu on swipe when is revealed? |
ok, i'll put my two cents in. in TableViewController.h add UIGestureRecognizerDelegate -(void)viewWillAppear:(BOOL)animated{
self.revealController.revealPanGestureRecognizer.delegate = self;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
if (self.tableView.editing)
return NO;
else
return YES;
} this way it doesn't interfere with uitableviewcell delete gesture |
I've inserted a
UINavigationViewController
with aUITableViewController
as thetopViewController
and saw that the defaultPKRevealController
tap recognizer interferes with the table view selection.I have a fix that I can submit as a pull request if you wish.
The text was updated successfully, but these errors were encountered: