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()
}