don't know if you have encountered this situation, I use the function
func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ReusableCell.self), for: indexPath) as! ReusableCell
cell.reloadAction = {
tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none)
}
return cell
}
to retrieve reusable cell. But now every time I reload the cell, call this function again and it is returning 2 different cells at each call. I draw cells on the storyboard so I don't have the ability to register cells multiple times in the code. If you've ever encountered this case, please help me, I'm very confused :( Thank you very much.
your identifier name seems strange (you don't need to specify its type (String): is that the one you have set in the interface builder pane? I suggest you to check the identifier name and give a try with a code like: withIdentifier: "myCell". Hope this will help.