0

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

Arun
  • 3,406
  • 4
  • 30
  • 55
Chetan sharma
  • 378
  • 5
  • 21
  • [Go through the link][1] [1]: http://stackoverflow.com/questions/17254402/swipe-to-delete-and-the-more-button-like-in-mail-app-on-ios-7 It might help you. – madhu Dec 22 '14 at 05:03
  • This will help you to implement swipe table view in iOS 8, follow the tutorial and download the custom class provided in Github http://www.appcoda.com/?s=swipe+tableview – vijeesh Dec 22 '14 at 05:11

0 Answers0