New in iOS 8, you can obtain 100% dynamic table view cells by simply setting the estimated row height, then layout your elements in the cell using Auto Layout. If the conten
I modified iuriimoz answer. Just replaced viewWillAppear method:
tableView.sectionHeaderHeight = UITableViewAutomaticDimension
tableView.estimatedSectionHeaderHeight = 25
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Recalculates height
tableView.layoutIfNeeded()
}
Also add the tableView.layoutIfNeeded() to
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
tableView.layoutIfNeeded()
}
For iOS 10
tableView.beginUpdates()
tableView.endUpdates()
have "fade" animation effect on viewWillAppear for me