I am implementing uitableview, where I have 5 cells in total (each is having webview in it with dynamic text). I am implementing 2 xib in this tableview.
But I am having problems with adjusting the height of tableview
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension . // is returning a -1 value
}
I have already set these properties before reloading my tableview
self.myTableview.rowHeight = UITableView.automaticDimension
self.myTableview.estimatedRowHeight = 300
But not able to calculate the height dynamically. I have cross-checked the constraints in xib file and attaching the constraints which I have applied to tableview.
Any suggestions on how I can solve this?