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

Buggy when combining SW and TableView editing delegate methods #167

Closed
jeffhatz opened this issue May 26, 2014 · 6 comments
Closed

Buggy when combining SW and TableView editing delegate methods #167

jeffhatz opened this issue May 26, 2014 · 6 comments

Comments

@jeffhatz
Copy link

When I'm using just SWTableViewCell, everything works perfectly.

However, when combining it with native UITableViewCell delegate methods for editing functionality, such as tableView:commitEditingStyle:forRowAtIndexPath or tableView:canMoveRowAtIndexPath:, it gets glitchy sometimes.

I'm not doing anything out of the ordinary: tableView:cellForRowAtIndexPath: is setting rightUtilityButtons then the delegate, per the SW sample app. The tableView delegate methods are also pretty straight forward, they simply allow reordering, and deleting. I don't really care about deleting via the tableView delegate since I'm handling that in SW, but I need reordering and delete comes free with that when in edit mode.

It looks like adding this resolves the problem. It would be nice if this "fix" wasn't necessary.

  • (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
    {
    return UITableViewCellEditingStyleNone;
    }

Here's what I'm seeing happen:
https://www.dropbox.com/s/rw0m5469m2nelrb/SWTableViewCell.mov

@Saadi6
Copy link

Saadi6 commented May 31, 2014

I second that. Adding that method resolves those issues. Notice that without this method, the output log spits messages about editing style already set to delete and other constraint issues.

I assume since we implement our own delete method instead of the one implemented by UITableViewDelegate, this method (returning a style of none) should be required.

@nod
Copy link

nod commented Nov 13, 2014

I realize this issue is closed, but I am using 0.3.6 and am seeing something odd. If I set the table to editing=YES, swipe events aren't registered. I am using the editing mode to always have reordering available.

I tried the above fix and it's not working. No swipe gestures are recognized (apparently) with editing enabled.

@karadza3a
Copy link

@nod Have you found a solution for swipe gestures not being recognized?

@RogyMD
Copy link

RogyMD commented May 20, 2015

A solution: You can implement -respondsToSelector: method in your controller and return NO when is asking about @selector(tableView:commitEditingStyle:forRowAtIndexPath:). Anything like this:

-(BOOL)respondsToSelector:(SEL)aSelector {
  if (@selector(tableView:commitEditingStyle:forRowAtIndexPath:) == aSelector) {
    return NO;
  } else {
   return [super respondsToSelector:aSelector];
  }
}

@buttcmd
Copy link

buttcmd commented Sep 30, 2016

@nod @karadza3a Have you found a solution to this?

@nod
Copy link

nod commented Sep 30, 2016

@buttcmd sorry, I actually no longer work on that app. I don't recall ever coming up with a good solution and ended up rewriting it to use a different lib.

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

7 participants