NSURLProtocol and WKWebView

We have a NSURLProtocol registered to intercept http/https requests made by UIWebView. 

What is the equivalent way of accomplishing this with WKWebView?


Replies

Since iOS 11 it is possible to declare an object that conforms to the WKURLSchemeHandler protocol and register it in the WKWebView configuration: -[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:].

Reference: https://stackoverflow.com/a/24208322/9503097