-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird edge case issue with DrawerGestureModePanning #25
Conversation
I've thought about providing a callback block to let a implementor determine if that touch should be recognized for a specific gesture... I'll see if I have time to throw something together this week. BTW - > Use a |
Put together a potential solution here: 940989c |
@larsacus need eyes on that as well. |
Resolved merge with c35a65b |
Conflicts: MMDrawerController/MMDrawerController.h MMDrawerController/MMDrawerController.m
@danmurrelljr Let me know if you think that would solve your problem. |
Wouldn't it be more flexible to let users register "allowed" gesture recognizers? There may be several screens in the project that require different gesture recognizers to work. |
Hey @yfujiki, In that case, you could have each view controller reset that block to define the behavior that they want... When you say "register allowed gesture recognizers", what did you have in mind? |
What I had in mind was that But I think your suggestion simply works, as long as I reset the block in But at least, isn't it better to allow multiple gesture recognizers in the block parameter? In my situation, I have left/right swipe gesture recognizers, and the swipe recognizers seem to conflict. Hypothetically, a view can consist of several subviews that have different pan gesture recognizers as well. |
For your last point, you actually dont need multiple pan gesture recognizers. You can simply take the touch point, inspect your view, and determine if that gesture should be recognized. We're looking at trying to roll this out soon. |
Conflicts: MMDrawerController/MMDrawerController.m
@kcharwood https://github.com/kcharwood That is true. Although it introduces a little bit of constraints of coding On Tue, Jul 16, 2013 at 3:44 PM, Kevin Harwood notifications@github.comwrote:
|
@yfujiki I'm not sure I am trying to solve the swipe gesture use case. The swipe gesture seems a bit out of place since the swipe gesture requires the gesture to complete before its callback happens, while the pan gesture gives the user immediate feedback and allows them to manipulate the screen directly. You should be able to add swipe gestures to your view controllers and just manually call to open/close the drawer when they occur. |
Hi guys, I have been using the inferis View Deck lib and now im converting to yours. This one looks better and cleaner. In View Deck this problem does not exist. The pan gesture to open another VC is only activated if the views in front has no gestures recognisers. for Ex: a delete movement in a cell will not trigger the pan |
Hey @jonasman, Thanks for the comments. This library is actually a bit cleaner due to how we handle the gestures, so I don't think it would be trivial to migrate to the ViewDeck approach. For all in this thread, here is an example of how this approach could be used: [myDrawerController setOpenGestureModeMask:MMOpenDrawerGestureModeCustom];
[myDrawerController
setGestureShouldRecognizeTouchBlock:^BOOL(MMDrawerController *drawerController, UIGestureRecognizer *gesture, UITouch *touch) {
BOOL shouldRecognizeTouch = NO;
if(drawerController.openSide == MMDrawerSideNone &&
[gesture isKindOfClass:[UIPanGestureRecognizer class]]){
UIView * customView = [drawerController.centerViewController myCustomSubview];
CGPoint location = [touch locationInView:customView];
shouldRecognizeTouch = (CGRectContainsPoint(customView.bounds, location));
}
return shouldRecognizeTouch;
}]; I'll leave this thread open for comment for another day or two before tying it off and shipping 0.3.0. |
Weird edge case issue with DrawerGestureModePanning
I'll be shipping this in 0.3.0 today. |
@kcharwood Im attempting to use setGestureShouldRecognizeTouchBlock. Im just putting in a return NO; and my drawer controller is still panning. I have a uiSwitch in the center of my CenterViewController that I basically can't turn on or off because it wants to pan. Any ideas? |
I figured it out, I was resetting the Custom Pan Mode to Bezel by mistake. |
Our case is we have a central view, that uses a custom navigation bar, and not a standard navigation controller. So by appearances, there looks to be a navigation bar on screen.
Our central view has a drawing/annotating element, so needs to listen to touch events, which the center panning mode is eating up.
If I set the open/close drawer mask to MMOpenDrawerGestureModePanningNavigationBar, the center basically goes dead.
There is a redesign of the center controller's UI underway, but any alternatives in the meantime?