uitableview cell on swipe two Button

Supports ios 8 and above

-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(
NSIndexPath *)indexPath {
   
    UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Do Not Track" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
    {
     
        //write code
       
    }];
    editAction.backgroundColor = [UIColor grayColor];
   
   
    UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Delete"  handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
       
       //write code here
       
    }];
   
    deleteAction.backgroundColor = [UIColor redColor];
   
    return @[deleteAction,editAction];
}

Comments

Popular posts from this blog

Swift: UserDefaults protocol

Download .dmg file of Xcode

How to setup Xcode Swift Project to use LLVM C APIs