Open xgqfrms opened 4 years ago
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {
var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let myURL = URL(string:"https://www.apple.com")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}
override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
}
WKWebView & UIWebView
https://developer.apple.com/documentation/webkit/wkwebview
https://developer.apple.com/documentation/uikit/uiwebview
https://www.cnblogs.com/xgqfrms/p/13883680.html
https://www.cnblogs.com/xgqfrms/p/13881595.html