[Solved] expected Declaration (Won’t Compile) [duplicate]


Try this. I’m assuming the return true does not belong there. You can’t return a value outside of a method.

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
    if editingStyle == .delete {
        self.contacts.remove(at: indexPath.row)
        tableView.deleteRows(at: [indexPath], with: .fade)
    }
}

solved expected Declaration (Won’t Compile) [duplicate]