I am trying to implement delete button in UITableView on iOS8
in objective-c
, but in iOS8
swipe and delete feature is not work as work in iOS7
. can any one please help me how to implement this feature in iOS8
table view.
I want to do this in objective-c not in Swift.
I am using this code,
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if ([myDataArray count]>0)
return YES;
else
return NO;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleDelete;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
// Called when "DELETE" button is pushed.
cellIndex=indexPath.row;
}
If any one know about this how can i do this, then please help me, in detail.
Thanks in advance