is there a possibility to get number detected in UIWebView
.
When I click a number inside UIWebView on my iPad I get popover with following choices:
Send Message, Add to Contacts, Copy.
How can I remove that popover and get detected number?
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,100,1024,768)];
webView.dataDetectorTypes = UIDataDetectorTypePhoneNumber;
NSURL *url = [NSURL URLWithString:@"somepage"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[webView loadRequest:urlRequest];
UIWebView
detects phone numbers and when I click on number, system shows me popover.
Interesting thing is that none of the UIWebViewDelegate
methods is called when I tap on the number.
I only need to get detected number.
Stop detecting numbers and have them as links instead. So when you press the link (Number) it will take you into the
shouldStartLoadWithRequest
method.The code below should help I have commented to detail what each line does if you need anything else just ask.
The code will work on a link like:
UPDATE
I have just realized that you aren't setting your
webView
s delegate. So in your .h file make sure you have:then after
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,100,1024,768)];
you need to do[webView setDelegate:self];
this will set it up so it should use the delegate methods.If you have any more issues just leave a comment.