Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
- UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Button1" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
- // maybe show an action sheet with more options
- [self.tableView setEditing:NO];
- }];
- moreAction.backgroundColor = [UIColor blueColor];
- UITableViewRowAction *moreAction2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Button2" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
- [self.tableView setEditing:NO];
- }];
- moreAction2.backgroundColor = [UIColor blueColor];
- UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
- [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
- }];
- return @[deleteAction, moreAction, moreAction2];
- }
- deleteAction.backgroundColor = UIColor(patternImage: UIImage(named:"sample")!)
Add Comment
Please, Sign In to add comment