I'm working on a FAQ page in my iPhone App. I have some question links on top will direct to answer in bottom. Some answers have external links which I want to open in Safari instead of UIWebView.
I found this code from here:
-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
if ( inType == UIWebViewNavigationTypeLinkClicked ) {
[[UIApplication sharedApplication] openURL:[inRequest URL]];
return NO;
}
return YES;
}
For some reason I need to click the link twice to open the link. First time touch the link it highlight's it. Second time touch the link it goes to the destination or for my external links it opens in Safari. However if I remove the above code it works on the first touch but external links opens in my WebView.
Note: I have a UIWebView delegate name wvFAQ. Do you think I'm missing something on the code?
Question: How to open the link in single click?