Open link starting with http but not www

后端 未结 3 920
萌比男神i
萌比男神i 2021-01-23 20:48

I want to open link starting with www they do not open. My code working only for http. Please help > I am newer in iOS.I shall be highly obliged.

- (BOOL)webView         


        
相关标签:
3条回答
  • 2021-01-23 21:28

    Kindly add one more else if

    else if([request.URL.absoluteString rangeOfString:@"www://"].location != NSNotFound) {
        return YES;
    }
    

    its also advisable to add, http:// before each URL you've, and for a note some URL may be of secure network so their extension can be https://.

    0 讨论(0)
  • 2021-01-23 21:32
    NSURL *url=[NSURL URLWithString:@"http://"];
    
    [self.myWebView loadHTMLString:tempString baseURL:url];
    
    0 讨论(0)
  • 2021-01-23 21:55

    [self.myWebView loadHTMLString:tempString baseURL:[NSURL URLWithString:@"http://"]];

    0 讨论(0)
提交回复
热议问题