Swift Version --> Remove the object from your data array before you call
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
print("Deleted")
currentCart.remove(at: indexPath.row) //Remove element from your array
self.tableView.deleteRows(at: [indexPath], with: .automatic)
}
}