If App has an Web View and web view has some link and we want to identify the click event and open the link in safari or open mail window, then follow as below code.
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
//CAPTURE USER LINK-CLICK.
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
NSURL *URL = [request URL];
if ([[URL scheme] isEqualToString:@"http"]) {
[[UIApplication sharedApplication] openURL:URL];
return NO;
}
else if ([[URL scheme] isEqualToString:@"mailto"]) {
[[UIApplication sharedApplication] openURL:URL];
return NO;
}
}
return YES;
}
I am using m.youtube.com in my app, now it showing all list of videos. i click on any video,then that link How can I get.
ReplyDeleteIf any body have any idea, plz let me know.
ReplyDelete