How to load URL on WKWebView?

First of all you need to import

import WebKit

Following code is enough to open URL with WKWebView

let webView = WKWebView(frame: <#AnyRect#>)
let link = URL(string:"https://developer.apple.com/videos/play/wwdc2019/239/")!
let request = URLRequest(url: link)
webView.load(request)

Use -

webView.load(URLRequest(url: URL(string: "https://www.google.com/")!))

For Objective-c

  1. Goto Target -> Frameworks, Libraries, and Embed content
  2. Add Framework "WebKit.framework"
  3. Open your file and add #import

implement code in the function that you want to load WKWebView

WKWebView *webView = [[WKWebView alloc] init];
webView.frame = self.view.bounds;
[self.view addSubview:webView];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.apple.com"]];
[webView loadRequest:request];