I am running a demo project on iOS 11 device. There is a certain url which i am loading in SafariViewController using below code, which works fine.
NSURL *url = [NSURL URLWithString:@"https://myCustomUrlHere"];
SFSafariViewController *svc = [[SFSafariViewController alloc] initWithURL:url];
svc.delegate = self;
svc.preferredBarTintColor = [UIColor blackColor];
svc.hidesBottomBarWhenPushed = true;
svc.editing = YES;
[self presentViewController:svc animated:YES completion:nil];
If the same url if i try to load in WKWebView i am getting browser not compatible issue. It says i need at least Safari 5+ in my device. Since i am running in iOS 11 device i suppose it should open in WKWebView as well.
Here is my code for WKWebView :
WKWebViewConfiguration* webConfig = [[WKWebViewConfiguration alloc] init];
self.wkwebview = [[WKWebView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, self.view.frame.size.height) configuration:webConfig];
self.wkwebview.UIDelegate = self;
self.wkwebview.navigationDelegate = self;
self.view = self.wkwebview;
NSURL *nsurl = [NSURL URLWithString:@"https://myCustomUrlHere"];
NSURLRequest *request = [NSURLRequest requestWithURL:nsurl];
[self.wkwebview loadRequest:request];
I implemented some WKNavigationDelegate methods, but none helped. I even referred this link `
I am not understanding whats stopping the wkwebview to load the url?