App state restoration and WKWebview

I have a viewcontroller (on a storyboard) that contains a WKWebView.


When performing app state restoration, the viewcontroller is restored fine but of course, the WKWebView is not since it does not support app state restoration.


I'm planning on saving out the browse history of the WKWebView and then later cycling through it to put the user back to where they were.


My problem is where do I save out the data (viewWillDisappear?) and more importantly, where do I read it back in? I can't just use viewWillAppear because I don't know if we are back on this view because of app state restoration or because the user tapped on a table cell in a previous view and brought us to this detail view.


If the user tapped on a table cell to bring us here, we do not need to restore the browse state of the WKWebView, only when the app state is restored.


Does anyone have any ideas?


Thank you!

Accepted Reply

Don't think you can get there from here w/WKWebView.


UIWebView is deprecated w/iOS, but it might be the only way to reach your goal.

Replies

Don't think you can get there from here w/WKWebView.


UIWebView is deprecated w/iOS, but it might be the only way to reach your goal.