Make links That inside UIWebview clickable
suggest changeIn vc.h
@interface vc : UIViewController<UIWebViewDelegate>
in vc.m
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
if (navigationType == UIWebViewNavigationTypeLinkClicked){
//open it on browser if you want to open it in same web view remove return NO;
NSURL *url = request.URL;
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
return NO;
}
return YES;
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents