OK, setting UIDataDetectorTypeNone for dataDetectorTypes should prevent web browsing from detecting links, thatβs right.
Also using
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
UIWebview divider, you can simply return NO for a URL that you do not want the user to allow the following ...
Alternatively, you can embed custom CSS rules after the page has finished loading in
- (void)webViewDidFinishLoad:(UIWebView *)webView
delegate a method this way:
[MywebView stringByEvaluatingJavaScriptFromString:@"document.styleSheets[0].addRule(\"a.link\", \"color:#FF0000\")"];
So, based on the CSS from the mentioned thread, this should work:
[MywebView stringByEvaluatingJavaScriptFromString:@"document.styleSheets[0].addRule(\".active\", \"pointer-events: none;\");document.styleSheets[0].addRule(\".active\", \"cursor: default;\")"];
source share