UITableView cell deletion not working even after deleting a particular cell

173 views Asked by At

I have a table view cell which should delete the particular table view cell if I swipe but the image is not deleted but the contents in the row except image are deleting.

func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
        if editingStyle == .delete {
            print("Deleted")
            
            name.remove(at: indexPath.row)
            miscellaneousText.remove(at: indexPath.row)
            amount.remove(at: indexPath.row)
            images.remove(at: indexPath.row)
            tableView.deleteRows(at: [indexPath], with: .fade)
            tableView.reloadRows(at: [indexPath], with: .automatic)
            
            
}
    }
0

There are 0 answers