title: Restore Position in UIWebView
body: <p>I need to store the current position in a UIWebView to disk and reload it from disk on a later launch.</p>
  
  <p>What I did before was to store the <code>window.scrollX</code> and <code>window.scrollY</code> with an javascript position.
  This works good for many cases.</p>
  
  <p>Additionally I store the scale by getting the current:</p>
  
  <pre><code>webView.scrollView.zoomScale
  </code></pre>
  
  <p>and restore it by setting the viewports initial scale to it with javascript.</p>
  
  <p>All of this works but isn't reliable. Is there an better way?</p>
  
  <p>I read about <code>UIWebView</code>'s <code>restorationIdentifier</code> but I'm not sure if I can save it to disk?</p>