Hi,
In my application I have to periodically refresh data displayed in UITableView. After refreshing the model objects I do something like this:
if let indexPaths = tableView.indexPathsForVisibleRows {
tableView.beginUpdates()
tableView.reloadRows(at: indexPaths, with: .none)
tableView.endUpdates()
}
Everything works as expected except the focused cell is changed (i.e. reloadRows doesn't preserve foucsed cell). I have also set remembersLastFocusedIndexPath to true but it doesn't help in this case. I'm not sure wether beginUpdates and endUpdates are required here but the behavior is the same with and without them.
So my question is. Is there any way to update the visible cells without loosing focus?
regards,
Michal