我正在使用以下代码检测我的uiwebview上的链接点击。有没有办法获取用户点击过的链接文本?
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
NSLog(@"link tapped");
if(navigationType == UIWebViewNavigationTypeLinkClicked) {
//if (overrideLinksSwitch.on == TRUE) {
NSLog(@"navigation link tapped");
// [self myMethodAction];
// [myWebView stopLoading];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:linktapped]];
return NO;
}
return YES;
}
任何帮助表示感谢。