I have the following method in a UIViewController:
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType.
My webview has two links in the view; I want to be able to distinguish between the two of them so that I know which one the user clicked on.
Does anyone know how to?
You must extract a url string from NSURLRequest:
Then use currentPath to compare with your two URLs. If those URL are unknown you should parse your html file to find them in it. You cannot get access to HTML document structure through UIWebView because it is extremely complicated.