im new in programming and have a project with wkwebkit written is swift 3 that load page with an ipa file in a url but the wkwebkit cant install the app unlike the uiwebview this is the code
import UIKit
import WebKit
var WEB : WKWebView!
class FirstViewController: UIViewController , WKNavigationDelegate {
override func viewDidLoad() {
super.viewDidLoad()
let myBlog = "https://www.pgyer.com/EcCK"
let url = NSURL(string: myBlog)
let request = URLRequest(url: url! as URL)
// init and load request in webview.
WEB = WKWebView(frame: self.view.frame)
WEB.navigationDelegate = self
WEB.load(request)
self.view.addSubview(WEB)
self.view.sendSubview(toBack: WEB)
}
override var prefersStatusBarHidden: Bool {
return true
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) {
if let urlResponse = navigationResponse.response as? HTTPURLResponse,
let url = urlResponse.url,
let allHeaderFields = urlResponse.allHeaderFields as? [String : String] {
let cookies = HTTPCookie.cookies(withResponseHeaderFields: allHeaderFields, for: url)
HTTPCookieStorage.shared.setCookies(cookies , for: urlResponse.url!, mainDocumentURL: nil)
decisionHandler(.allow)
}
}
}