title: Setting contentInset of WKWebView scrollView causes page jump to top
body: <p>After setting <code>contentInset</code> of <code>WKWebView</code>, I found if I use default swipe gesture to navigate between pages, <code>WKWebView</code> will not reserve the <code>contentInset</code> and just <strong>jump</strong> to the top, does anyone know how to resolve that? Thanks!</p>
  
  <p><a href="https://i.stack.imgur.com/Lp9mi.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lp9mi.gif" alt="enter image description here"></a></p>
  
  <p>My sample code:</p>
  
  <pre><code>import UIKit
  import WebKit
  
  class ViewController: UIViewController {
  
      private lazy var webView: WKWebView = {
          let view = WKWebView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
          view.allowsBackForwardNavigationGestures = true
          view.scrollView.contentInsetAdjustmentBehavior = .never
          view.scrollView.contentInset = UIEdgeInsets(top: 50, left: 0, bottom: 0, right: 0)
  
          view.navigationDelegate = self
          return view
      }()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
          self.view.addSubview(self.webView)
  
          if let url = URL(string: "http://www.wikipedia.org") {
              self.webView.load(URLRequest(url: url))
          }
      }
  
  }
  </code></pre>