我需要从UIWebView迁移到WKWebView,但我不能。有人知道吗?
importUIKit
class ViewController: UIViewController {
let URL:String = "https://google.com"
@IBOutlet weak var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = NSURL (string: URL);
let requestObj = NSURLRequest(url: url! as URL);
webView.loadRequest(requestObj as URLRequest);
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
答案 0 :(得分:0)
您只需要更改,将UIWebView
的{{1}}添加WKWebView
并将Outlet的类名称更改为WKWebView,还将import WebKit
的{{1} }}
loadRequest
答案 1 :(得分:0)
新的API将相同
FeignContext-xxx