In my application , the tableview is having different types of custom cells with different heights. I want to put a view below this tableView, for which I need to calculate
This is an old question, but, today I've solved my problem with this
func viewDidLoad() {
super.viewDidLoad()
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 44 // >= 2
}
func getTableViewHeight() -> CGFloat{
tableView.reloadData()
tableView.layoutIfNeeded()
return tableView.contentSize.height + tableView.contentInset.bottom + tableView.contentInset.top
}