Я новичок в кодировании и учебе быстро, я следую учебному курсу для быстрого 2 и работаю с быстрым 3, поэтому есть несколько проблем, которые у меня есть, когда я следую за ним, и это то, что я правильно застрял.
У меня есть таблица имен, и я делаю для них функцию удаления и удаления, которая удаляет их из переменной имен, которая является массивом. Я выбрал функции, которые наиболее близко напоминают учебник внутри xcode и заполняют их, но мое приложение случайно падает при нажатии кнопки удаления. Вот мой код для кнопки удаления...
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let deleteAction = UITableViewRowAction(style: .destructive, title: "Delete") { (rowAction: UITableViewRowAction, indexPath: IndexPath) -> Void in
print("Deleted")
self.catNames.remove(at: indexPath.row)
self.tableView.deleteRows(at: [indexPath], with: UITableViewRowAnimation.automatic)
self.tableView.reloadData()
}