When I call this code:
tableView.reloadRows(at: [IndexPath(item: index, section: 0)], with: .none)
tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: changeBankCardTableViewCellReuseId) as! MyCell
}
This cell dequeued is new cell, even that this cell is showing (I do not want to create a new, because my cell have a timer, it change my title)
So I change my code, like this:
let indexPath = IndexPath(item: index, section: 0)
if let cell = bundTableView.cellForRow(at: indexPath),
cell is ChangeBankCardTableViewCell {
let myCell: ChangeBankCardTableViewCell = cell as! MyCell
/// do some thing
}
But, this is too long, and myCell must export function to call.
dequeueReusableCell
will create a new cell? Why? I think if cell exists, need not create.