Table view slide cell with default action

iOS8 now provides a way to create a table cell with the ability to move with actions. In the Apple own Mail application, you can also lock the default action if you completely drag the cell (the Mail application displays “More”, “Flag” and “Trash”, and the default is “Trash” if you drag and drop completely and release). Is there any way to do this in iOS 8?

+4
source share
2 answers

If you are referring to deleting deleted pages in TableViews, you can use this code:

//Enable multiple selections during editing
self.tableView.allowsMultipleSelectionDuringEditing = NO;

//Enable editing row
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return YES if you want the specified item to be editable.
return YES;
}

//Do something on delete
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
    //add code here for when you hit delete
}    
}
0
source

, , API. , - :)

JASwipeCell

0

All Articles