christijk
christijk

Reputation: 2213

UIWebView shouldStartLoadWithRequest not calling for some links

In my UIWebView I’m loading twitter page. I want to open all the clicks inside the webView as a separate page. So I implemented the shouldStartLoadWithRequest:

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request     navigationType:(UIWebViewNavigationType)navigationType

{
    //if inlineLink.
    if (UIWebViewNavigationTypeLinkClicked == navigationType )
    {
        InLineWebViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:kInLineWebViewControllerStoryboardID];
        viewController.urlString= [[request URL] absoluteString];
        [self presentViewController:viewController animated:YES completion:nil];
        return NO;
    }

    return YES;
}

This code is working perfectly for some links. But unfortunately its not working for all the links, for example the twitter reply/re-tweet links. Any help would be appreciable. Thanks in advance.

Upvotes: 0

Views: 2667

Answers (1)

iphonic
iphonic

Reputation: 12719

As per my knowledge the function shouldStartLoadWithRequest gets called only for urls which is going to load content or, load new webview frame. See here

There are few kind of urls which might be assigned to javascript that doesn't actually load a page, may not work..

Upvotes: 2

Related Questions