Я хочу удалить одну строку из таблицы в Swift 5 и удалить объект из массива.Я много искал, но не смог этого сделать.
Я перепробовал все связанные решения, доступные в StackOverflow, но не смог его найти.
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
let position = indexPath.row
if (editingStyle == .delete) {
labDetailsTableView.beginUpdates()
if let idx = labs.firstIndex(where: { $0 === position }) {
labs.remove(at: idx)
}
labDetailsTableView.endUpdates()
}
}
Бинарный оператор '=== 'нельзя применять к операндам типа' LabDetails 'и' Int '