turbolinks / turbolinks-ios

Native iOS adapter for building hybrid apps with Turbolinks 5
MIT License
881 stars 92 forks source link

Add ability to trigger a full reload of WebView. #125

Closed gearoidoceallaigh closed 6 years ago

gearoidoceallaigh commented 6 years ago

It would be nice to be easily perform a full reload of a page upon navigation.

An example case would be where the developer may wish to forget about the CSS defined on a previous page.

At the moment, this is possible by doing the following:

visitable.visitableView.webView?.reload()

However, I'm wary about accessing WKWebView directly - there may be some callbacks that are not triggered as a result of such an action.

I think the following would be nice:

visitable.visitableView.fullReload()

zachwaugh commented 6 years ago

The Session object does provide a reload() function that does exactly this - https://github.com/turbolinks/turbolinks-ios/blob/master/Turbolinks/Session.swift#L84. You can also call it from the Visitable as well - https://github.com/turbolinks/turbolinks-ios/blob/master/Turbolinks/Visitable.swift#L27