How to delete rows in different section of tableview with swift?

56 Views Asked by At

I am using this to delete rows in different sections.

 override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(true)
        for i in 0..<sectionArray.count{//Section
            for j in 0..<rowArray.count{//row
                let indexPath = IndexPath(row: j, section: i)//indexpath
                self.tableView.deleteRows(at: [indexPath], with: .fade)
            }
        }
        tableView.reloadData()
    }
0

There are 0 best solutions below