Skip to content
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

Pan gesture recognizer interferes with UITableViewCell reorder control #2

Closed
leonbreedt opened this issue Jan 30, 2013 · 5 comments
Closed

Comments

@leonbreedt
Copy link

Hi!

The pan gesture recognizer prevents the UITableViewCell reorder control from functioning correctly when the tableview is in editing mode, and the UITableView is contained within a controller that is a content controller.

I have successfully worked around this by adding NVSlideMenuController as a UIGestureRecognizerDelegate of the pan gesture recognizer, and in -gestureRecognizerShouldBegin:, returning NO if the content view controller is in editing mode, but this is not 100% reliable. E.g. if the content view controller is a navigation controller that wraps the actual content controller.

Another way could be to only respect horizontal pans, and somehow have the original gesture recognizer on the reorder control process vertical ones, but I did not investigate this option fully.

Leon

@nverinaud
Copy link
Owner

Did you try setting panEnabledWhenSlideMenuIsHidden to YES when you enter in editing mode ?

Hum... I'll override the setter to change the enabled property of the pan gesture if the menu is hidden.

@leonbreedt
Copy link
Author

Hi Nicolas,

Thanks for the quick response! Not sure I understand 100% how that would address the issue, but please correct me if I'm misunderstanding :)

I'll try to explain a bit more.

I have NVSlideMenuController wrapping a menu view controller, and a content view controller. The content view controller is a UINavigationController that contains a top view controller with a UITableView filling its bounds.

This works great, and when I pan from left to right, the content controller slides over and reveals the menu, as expected.

The UITableViewCell in the content controller have showsReorderControl set to YES. As you probably know, when the table view is in edit mode, it puts a control on the right hand side of the cell so you can tap & then drag vertically to reorder the cells.

When the table view is in edit mode, with NVSlideMenuController pan gesture enabled, I can't drag cells more than one row, and for some reason the drag is automatically stopped after one row of movement vertically.

I don't think that the menu visible or hidden affects this, when I have this problem I don't have the menu visible at all, which is why I'm not sure whether your suggestion will fix this.

Does that clarify things?

I can take some screenshots to show what I mean if that would help :)

Awesome library by the way, I've tried most of them, and discovered yours through NSScreencast.

Thanks!
Leon

@nverinaud
Copy link
Owner

I see exactly what you mean. The panEnabledWhenSlideMenuIsHidden property in fact disable the pan gesture when the menu is hidden. What I need to do is override - setPanEnabledWhenSlideMenuIsHidden: in order to disable the pan gesture if I detect that the menu is hidden. I'll do it tomorrow ;-)

And thanks for compliments ;-)

nverinaud added a commit that referenced this issue Feb 1, 2013
**Deprecations**
* `panEnabledWhenSlideMenuIsHidden` is deprecated.
nverinaud added a commit that referenced this issue Feb 1, 2013
@nverinaud
Copy link
Owner

I invite you to use the new panGestureEnabled property. :)

@leonbreedt
Copy link
Author

Awesome, thanks! Removed my local hack :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants