Charles
Charles

Reputation: 493

How to detect Title and Subtitles in UIWebview?

How can one obtain the title of an webpage shown in UIWebview?

In addition, are there any way of detecting subtitles within the text in a block of text in UIWebview?

Alternatively, are there any way of identifying if a string is bold/italic/underlined? Or is that not stored?

Upvotes: 0

Views: 285

Answers (1)

xda1001
xda1001

Reputation: 2459

You can use javascript

For the first question

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    NSLog(@"title %@",[webView stringByEvaluatingJavaScriptFromString:@"document.title"]);
}

Upvotes: 1

Related Questions