I have a table view with cells that have a webView in them, I want the height of the cell to match the height of the webView.
This is the code I use:
I have one more solution that you should consider. Make a height constraint and link it to your UITableViewCell class. Then implement the delegate method func webViewDidFinishLoad(_ webView: UIWebView), and when it is called set the height constraint to be equal to webView.scrollView.contentSize.height.