- (BOOL) TableView: (uitableview *) Tableview caneditrowatindexpath: (nsindexpath *) indexPath{ return yes;} - (Uitableviewcelleditingstyle) TableView: (uitableview *) Tableview editingstyleforrowatindexpath :(nsindexpath *) Indexpath{ return uitableviewcelleditingstyledelete;} -(nsarray *) TableView: (uitableview *) Tableview editactionsforrowatindexpath: (NSIndexPath * ) indexpath{ uitableviewrowaction *laytoprowaction1 = [ uitableviewrowaction rowactionwithstyle:uitableviewrowactionstyledestructive title:@ "Delete" handler:^ (Uitableviewrowaction *action, nsindexpath *indexpath) { nslog (@ "clicked Delete"); [tableview setediting:no animated:yes]; }]; Laytoprowaction1.backgroundcOlor = [uicolor redcolor]; uitableviewrowaction *laytoprowaction2 = [uitableviewrowaction rowactionwithstyle:uitableviewrowactionstyledestructive title:@ " Pinned " handler:^ (Uitableviewrowaction *action, nsindexpath *indexpath) { nslog (@ "click on top"); [tableview setEditing:NO animated:YES]; }]; layTopRowAction2.backgroundColor = [UIColor greenColor]; UITableViewRowAction *layTopRowAction3 = [UITableViewRowAction rowactionwithstyle:uitableviewrowactionstyledestructive title:@ "More" handler:^ (UITableViewRowAction *action, nsindexpath *indexpath) { nslog (@ "Click for more"); [tableView setEditing:NO animated:YES]; }]; layTopRowAction3.backgroundColor = [UIColor Bluecolor]; nsarray *arr = @[laytoprowaction1,laytoprowaction2, Laytoprowaction3]; return arr;}
IOS8 using Uitableviewrowaction to implement cell custom sliding operations