-1

I am working on tableview cell in swift and I want to delete a particular cell with a delete button . I have tried taking button through storyboard but it does not works.

What can I do for it ?

Bhavin Ramani
  • 3,221
  • 5
  • 30
  • 41

1 Answers1

0

try this method for tableview ::

func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath)
    {
        if editingStyle == .Delete
        {
         //code for delete
        }
    }
Chirag Patel
  • 1,453
  • 1
  • 11
  • 21