I believe WKWebView
will open pages if the response has a status of 302. Can I stop the redirection from happening? Is there a delegate method that I can implement to decide if it should continue to navigate to the new resource?
optional func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: (WKNavigationResponsePolicy) -> Void)
Does not seem to be called if there was a redirection.
WKWebView
. However I use URLSession to send the request instead and capture 302 by myself do this trick. Maybe you should have a try – Popgun