I have some static HTML pages, I load into a WKWebView
by using the loadHTMLString(_:baseURL:)
method. A href
link inside a local HTML page loads another local HTML page with the same method.
The history navigation between the loaded local HTML pages have to work with swipe gestures (back and forward), so I set:
webView.allowsBackForwardNavigationGestures = true
localHTML <-(swipe back/forward)-> localHTML <-(swipe back/forward)-> localHTML
The goal is to have exactly the same optical behavior like the swipe navigation when using load(_:URLRequest)
, that means the preview of the upcoming history item (back and forward item).
(There was a similar question by another user, but the solution doesn't work for my problem: iPhone UIWebView loadHtmlString not added to history)