Question

I am having a webview content displaying in webview. In that content how do i find the tapped link is a Phone number or not. If it is a phone number i want make a call to that phone number.How to achieve this programmatically in ios 6.0 and above.

Was it helpful?

Solution

If you are just looking for detecting a phone number in webview's content, you can set the property in code:

@property(nonatomic) UIDataDetectorTypes dataDetectorTypes

self.webView.dataDetectorTypes = UIDataDetectorTypePhoneNumber;

Any detected phone number in the content will then be blue and underlined and tapping them will present a choice to call to that number.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top