uitableview cell on swipe two Button
Supports ios 8 and above
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(
NSIndexPath *)indexPath {
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle: UITableViewRowActionStyleNorma l title:@"Do Not Track" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
{
//write code
}];
editAction.backgroundColor = [UIColor grayColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle: UITableViewRowActionStyleNorma l title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
//write code here
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:
{
//write code
}];
editAction.backgroundColor = [UIColor grayColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:
//write code here
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
Comments
Post a Comment