MusiGenesis
MusiGenesis

Reputation: 75296

Why does a URL show up as a hyperlink in a UIWebView only after a few seconds?

I have an app that uses a UIWebView to display emails. If the email is an HTML email and it contains things like URLs or email addresses, these things show up immediately as hyperlinks. If the email is plain text, however, the same kinds of things get hyperlinked, but only after a few seconds. When the email is plain-text, I'm loading it like this:

[self.webViewBody loadData:[self.webViewRawHTML 
    dataUsingEncoding:NSUTF8StringEncoding]
    MIMEType:@"text/plain"
    textEncodingName:@"utf-8"
    baseURL:nil];

I'm 99% certain that this is completely out of my control and is just the way UIWebView behaves, but I'd like to know for sure. A google search doesn't seem to indicate that this is a general problem, but I don't think I have the search terms right.

Upvotes: 0

Views: 180

Answers (1)

Zoleas
Zoleas

Reputation: 4879

UIWebview has a property @property(nonatomic) UIDataDetectorTypes dataDetectorTypes wich tell the webview to automatically parse its whole content to search for links, address, phone numbers, etc. even if there is no <a>.

As it has to go over all its content, it takes severals seconds sometimes.

Upvotes: 2

Related Questions