I write custom jabber client in iphone.
I use xmppframework as engine.
And I have UITableViewController with NSMutableArray for repesent contact list.
<SWIFT 3:
self.collectionView.reloadData()
self.collectionView.selectItem(at: indexPath, animated: false, scrollPosition: [])
Swift 4.2 Tested
The correct way to update selected rows after reload table view is:
let selectedRows = tableView.indexPathsForSelectedRows
tableView.reloadData()
DispatchQueue.main.async {
selectedRows?.forEach { selectedRow in
tableView.selectRow(at: selectedRow, animated: false, scrollPosition: .none)
}
}