Gopinath
Gopinath

Reputation: 5442

How to control UITableView editing using swipe iphone app?

Am working in an iPhone app using UITableView. I have added the editing option in an UIViewController subview UITableView. When the user swipe the screen the Delete button is showing in this scenario i have changed the barbutton items 'Edit' to 'Done'. In this case i have tracked the control from below delegates,

- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

But when the user again swipe the view the "Delete" button is hiding but i can't trigger the control. So that i can't change the barbutton item "Done" to "Edit". Could you please help me to solve this problem? Where i can trigger the swipe control to hide the 'Delete' options? Thanks in advance.

Upvotes: 1

Views: 490

Answers (1)

Zhang
Zhang

Reputation: 11607

Does this work?:

- (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
    // update button title here
}

Upvotes: 1

Related Questions