I'm having the following problem.
I have an app using a UITableView with a custom UITableViewCell. Because of the specs of the app, I need it to be in edit mode always, so on the viewDidLoad I wrote this:
- (void)viewDidLoad
{
MainTableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"compose_background.png"]];
[MainTableView setAllowsSelectionDuringEditing: TRUE];
[MainTableView setEditing: TRUE];
[super viewDidLoad];
}
Also, I've implemented the following methods:
- (UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
- (BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
- (void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
And several more, but the problem persists and when I swipe a cell the delete button doesn't shows up. Any pointers would be highly appretiated.
- (UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
must return UITableViewCellEditingStyleDelete
for each row you want to delete. Swipe-to-delete is disabled in favor of this method when in editing mode.
I don't think there is anyway for the standard swipe to delete to work while the table view is in editing mode, you'd have to respond to gestures and add your own delete button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With