It is really easy to determine the height of the UIWebView based on content, once you know it šŸ˜‰

Here is a solution I used. (As seen from StackOverflow)

In a view controller’s viewDidLoad I load some HTML in a webview and when the load is finished run some javascript to return the element height.

- (void)viewDidLoad
[super viewDidLoad];
webview.delegate = self;
[webview loadHTMLString:@"<div id='foo' style='background: red'>The quick brown fox jumped over the lazy dog.</div>" baseURL:nil];

- (void)webViewDidFinishLoad:(UIWebView *)webView
NSString *output = [webview stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"foo\").offsetHeight;"];
NSLog(@"height: %@", output);

Also you may use the following code instead.

NSString *output = [webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"];

Hope this helps somebody