Open link starting with http but not www

后端 未结 3 924
萌比男神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://.

提交回复
热议问题