Как убрать warning?
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let context = appDelegate.persistentContainer.viewContext
guard let taskDelete = toDoItems.remove(at: indexPath.row) as? Task, editingStyle == .delete else {
return
}
context.delete(taskDelete)
do {
try context.save()
tableView.deleteRows(at: [indexPath], with: .automatic)
} catch let error as NSError {
print("Error: \(error), description")
}
}