Mars Mars - 6 months ago 151
Swift Question

Example of implementing 'WKNavigationDelegate' method 'didReceiveServerRedirectForProvisionalNavigation' method to follow redirects

I need a simple example in Swift to illustrate how I would implement the

WKNavigationDelegate
method
didReceiveServerRedirectForProvisionalNavigation
method to follow redirects.

Answer

Nothing needs to be done in this method to follow a redirect response. WKWebView will follow a redirect response without any further implementation necessary in the WKNavigationDelegate method didReceiveServerRedirectForProvisionalNavigation.