|
|
@ -17,7 +17,7 @@ class WkWebViewController: UIViewController, WKUIDelegate { |
|
|
|
|
|
|
|
override func loadView() { |
|
|
|
let webConfiguration = WKWebViewConfiguration() |
|
|
|
webView = WKWebView(frame: .zero, configuration: webConfiguration) |
|
|
|
webView = WKWebView() |
|
|
|
webView.uiDelegate = self |
|
|
|
view = webView |
|
|
|
} |
|
|
@ -28,13 +28,14 @@ class WkWebViewController: UIViewController, WKUIDelegate { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if let myURL = URL(string: self.url ?? "") { |
|
|
|
var myRequest = URLRequest(url: myURL) |
|
|
|
|
|
|
|
headers.forEach({ |
|
|
|
myRequest.setValue($0.key ?? "", forHTTPHeaderField: $0.value ?? "") |
|
|
|
}) |
|
|
|
|
|
|
|
// if let myURL = URL(string: self.url ?? "") { |
|
|
|
// var myRequest = URLRequest(url: myURL) |
|
|
|
// |
|
|
|
// headers.forEach({ |
|
|
|
// myRequest.setValue($0.key ?? "", forHTTPHeaderField: $0.value ?? "") |
|
|
|
// }) |
|
|
|
let url = URL.init(string: "https://www.apple.com") |
|
|
|
let myRequest = URLRequest.init(url: url!) |
|
|
|
webView.load(myRequest) |
|
|
|
} |
|
|
|
}} |
|
|
|
} |