I\'m using the code below to delete a row in my tableview. First I delete the object from my array and then from the tableview using this code:
let i = IndexPath
Any methods that insert or delete rows must be called inbetween tableView.beginUpdates()
and tableView.endUpdates()
. So your code must be:
let i = IndexPath(item: rowNum, section: 0)
myArray.remove(at: rowNum)
tableView.beginUpdates()
myTableView.deleteRows(at: [i], with: UITableViewRowAnimation.left)
tableView.endUpdates()