I am doing a quick test on WKWebView to evaluate its benefits and drawbacks. But i have found is that i am able to load urls using Xcode 6.4 and iOS 8 but having issues loading the same URL in Xcode 7 beta 3.
This is what i am doing :
- (void)viewDidLoad {
[super viewDidLoad];
// First create a WKWebViewConfiguration object so we can add a controller
// pointing back to this ViewController.
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc]
init];
WKUserContentController *controller = [[WKUserContentController alloc]
init];
// Add a script handler for the "observe" call. This is added to every frame
// in the document (window.webkit.messageHandlers.NAME).
[controller addScriptMessageHandler:self name:@"observe"];
configuration.userContentController = controller;
// This is the URL to be loaded into the WKWebView.
NSURL *jsbin = [NSURL URLWithString:k_JSBIN_URL3];
// Initialize the WKWebView with the current frame and the configuration
// setup above
_webView = [[WKWebView alloc] initWithFrame:self.view.frame
configuration:configuration];
// Load the jsbin URL into the WKWebView and then add it as a sub-view.
[_webView loadRequest:[NSURLRequest requestWithURL:jsbin]];
[self.view addSubview:_webView];
}
Is there something wrong i am doing or its just the beta version of Xcode and iOS 9? Thanks,