Custom TableViewRowAction
How to use:
- add #import "GFTableViewRowAction.h" in TableViewController
Example:
// custom UITableViewRowAction
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
float heightCell = [self tableView:tableView heightForRowAtIndexPath:indexPath];
GFTableViewRowAction* actionDelete = [GFTableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Delete" textColor:[UIColor redColor] backgroundColor:[UIColor whiteColor] icon:[UIImage imageNamed:@"delete"] heightCell:heightCell handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
NSLog(@"Delete action");
}];
GFTableViewRowAction* actionAttach = [GFTableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Attach" textColor:[UIColor blueColor] backgroundColor:[UIColor greenColor] icon:[UIImage imageNamed:@"attach"] heightCell:heightCell handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
NSLog(@"Attach action");
}];
return @[actionDelete, actionAttach];
}