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

UITableView Editing Issue (swipe to delete) #29

Open
malcommac opened this issue Nov 9, 2012 · 4 comments
Open

UITableView Editing Issue (swipe to delete) #29

malcommac opened this issue Nov 9, 2012 · 4 comments

Comments

@malcommac
Copy link

Hi,
I'm using PaperFold with a central UIView (an UIView with an UITableView inside) and a right UIView (an UIView with a Map).
Everything is fine but there is an issue when I try to use swipe-to-delete inside a cell of the table. I suppose the event is handled by the PaperFoldView class and the event itself is never fired:

  • (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;

and consequently:

  • (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;
@honcheng
Copy link
Owner

honcheng commented Nov 9, 2012

Hi,

I don't think swipe-to-delete & paperfold can go well together.
It's different to figure out user's intent, whether they want to delete or drag paperfold.
When I use it myself, I just have to add an edit button. Unless you have a better solution?

Sent from my iPad

On 9 Nov, 2012, at 8:28 AM, Daniele Margutti notifications@github.com wrote:

Hi,
I'm using PaperFold with a central UIView (an UIView with an UITableView inside) and a right UIView (an UIView with a Map).
Everything is fine but there is an issue when I try to use swipe-to-delete inside a cell of the table. I suppose the event is handled by the PaperFoldView class and the event itself is never fired:

(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;
and consequently:

(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;

Reply to this email directly or view it on GitHub.

@malcommac
Copy link
Author

The "problem" happends with the Pan gesture of PaperFoldView (init method):

panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onContentViewPanned:)];
[_contentView addGestureRecognizer:panGestureRecognizer];

I've tried to pass the event to it's subviews but the result is not good.
So I've added an util method to disable/enable pan gesture (when I need to edit the table I'm lucky because there is not any right/left fold view you can open).

Something like that:

  • (void) disablePanning:(BOOL) disable {
    if (disable)
    [_contentView removeGestureRecognizer:panGestureRecognizer];
    else
    [_contentView addGestureRecognizer:panGestureRecognizer];
    }

It's a bit dirty but at this time I've not found a better solution.

@honcheng
Copy link
Owner

honcheng commented Nov 9, 2012

when you need to edit the table, you can just disable panning for left and right folds. There are methods for that.
Swipe still doesn't work when you disable them?

@malcommac
Copy link
Author

Are u talking about enableLeftFoldDragging,enableRightFoldDragging? I've tried to set both as NO but it does not work (pan gesture still active)

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