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
I use the following code in my applications:
public func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath){
if editingStyle == UITableViewCellEditingStyle.delete
{
myArray.remove(at: indexPath.row)
myArray2.remove(at: indexPath.row)
// you would also save the new array here so that the next time you open the tableview viewController it shows the changes made.
mytableview.reloadData()
}
}