I have a UITableView with many rows, each row contains a UIWebView. The content of this webView is stored in my database (on the app), and the height of each cell in tableView is calculated based on the scroll height of my UIWebView.
Here is the problem, the loadHtmlString
method works asynchronously so when heighForRowAtIndexPath
method of UITableView get's called, the data hasn't been loaded in the UIWebView (because it works asynchronously). So I cannot calculate the required height for the cell.
So here is the question, is it possible to load the content of a UIWebView synchronously? my html text is very short, so it shouldn't take that long to load it synchronously.
EDIT: Is it possible to calculate the expected height of an html string without placing it inside a UIWebView, I know that this is possible using plain text, I don't know about html