I have a UITableView with many cells.
Each cells following it's contents have dynamic height.
But I notice that UITableView sometimes don't scroll the last indexPath when I enter this viewController.
Have any idea to fix it.
tableView.estimatedRowHeight = 200.0
tableView.rowHeight = UITableViewAutomaticDimension
let bottomOffSet = CGPoint(x: 0, y: self.tableView.contentSize.height - self.tableView.bounds.size.height)
self.tableView.setContentOffset(bottomOffSet, animated: false)
PS: I don't want to use "scrollToRow", because it would trigger tableview's function "cellForRowAtIndexPath" many times than "setContentOffset".
tableView.scrollToRow(at: IndexPath(row: contents.count - 1, section: 0), at: .top, animated: animated)