I am using a WKWebView with Swift 3 to display content that I want to save the state of. (Not possible within IOS itself) See for Reference. One of my ideas was to clone the current state of the webview to a hidden webview, however according to the apple documentation there is no pre-commit function, however there is a policy function to call as shown below
func webView(WKWebView, decidePolicyFor: WKNavigationAction,
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void)
//Decides whether to allow or cancel a navigation.
Overall I am looking to check a load request based on the URL before committing so I can do some action. Is this possible and what type of options do I have to accomplish this? Thank you!