Reputation: 129
Before iOS 15 after I made
self.tableView.beginUpdates()
self.tableView.endUpdates()
method heightForRowAtindexPath was called and my cell height changed without reloading data in the cell. Now in iOS 15 this not works! How can I force reload tableview cell height without reloading data in this cell?
Upvotes: 8
Views: 1700
Reputation: 363
I have already solved the problem. Apparently, Apple made a change in the way updates are processed and cell sizes are adjusted.
As the "hidden" cell is left at 0, when sending the beginUpdate
, it only processes the cells that have a value greater than 0, so that is why it no longer adjusts them.
What you need to do is change the value of 0, returned for hidden cells, to 0.01, and you're done!
I hope this solution works the same for me.
Upvotes: 6
Reputation: 129
Found a solution:
.
cell.heightContraint.constant = size
self.tableView.beginUpdates()
self.tableView.endUpdates()
So the cell is autoresizable now with UITableView.automaticDimension height and, of course, your view/container view should have top and bottom constraints equal to cell`s top and bottom constraints
Upvotes: 0