the second day I can not solve the problem with the table.
We have a segmentedControl which, when changed, changes the table. Suppose that there are 3 elements in th
Okay. So people finding issue with scrolling a tableview to the top with
self.tableView.setContentOffset(.zero, animated: false)
And need to do reload data unnecessarily to fix this !
So What is the issue with setContentOffset is kind of bug of iOS ?
The smallest and simplest answer is NO so what's the issue then ?
The answer is that dynamic row is using UITableView.automaticDimension. Tableview calculates its content offset with row height and with the number or sections and rows you have in your data source.
So in case of dynamic height is not performing the scrollToTop correctly, it is because it needs to recalculate every row height and content size.
So to reduce this bundle from tableview we, can provide an estimated row height like
self.tableView.estimatedRowHeight = 117 // whatever your value
Hopefully this will help someone :)