title: Diagonal swipe on web view populated by html script buggy after zoom
body: <p>I have a web view that display a table much larger than the screen. When I try to scroll it diagonally AFTER zooming - both in or out, it usually only scrolls in a single direction instead of diagonally. Is this behaviour due to web view's scrollview or could I have made mistake in my codes?</p>
  
  <p>This is how I populate my web view:</p>
  
  <pre><code>    webViewContent.scrollView.bounces = false
      webViewContent.scrollView.bouncesZoom = false
      webViewContent.scrollView.delegate = self
      webViewContent.scalesPageToFit = true
  
      var htmlString = "&lt;html&gt;&lt;head&gt;... ... a really long string that creates a table"
      webViewContent.loadHTMLString(htmlString, baseURL: nil)
  </code></pre>
  
  <p>Please do tell me if the htmlString might affect, I did not include it because it is really long.</p>
  
  <p>I also tried to synchronise the view with a header row called webViewTitle which I populate using similar codes but only one row. The synchronise codes are like:</p>
  
  <pre><code>func scrollViewDidZoom(_ scrollView: UIScrollView) {
      if(scrollView != webViewTitle.scrollView){
          var zoomPadding:CGFloat = 0.0
          if((currentZoomScale*webViewContent.scrollView.zoomScale) &lt; 1){
              zoomPadding = 0.5*(-acos(currentZoomScale*webViewContent.scrollView.zoomScale)*180.0/CGFloat.pi)
          }else{
              zoomPadding = 0.5*acos(2-(currentZoomScale*webViewContent.scrollView.zoomScale))*180.0/CGFloat.pi
          }
          webViewTitle.scrollView.zoom(to: CGRect(x: webViewContent.scrollView.contentOffset.x,
                                                  y: (355*currentZoomScale*webViewContent.scrollView.zoomScale) + zoomPadding,
                                                  width: webViewTitle.scrollView.bounds.width/currentZoomScale/webViewContent.scrollView.zoomScale,
                                                  height: webViewTitle.scrollView.bounds.height/currentZoomScale/webViewContent.scrollView.zoomScale),
                                       animated: false)
      }
  }
  func scrollViewDidScroll(_ scrollView: UIScrollView) {
      var zoomPadding:CGFloat = 0.0
      if((currentZoomScale*webViewContent.scrollView.zoomScale) &lt; 1){
          zoomPadding = 0.5*(-acos(currentZoomScale*webViewContent.scrollView.zoomScale)*180.0/CGFloat.pi)
      }else{
          zoomPadding = 0.5*acos(2-(currentZoomScale*webViewContent.scrollView.zoomScale))*180.0/CGFloat.pi
      }
      if(scrollView == webViewTitle.scrollView){
          webViewTitle.scrollView.contentOffset.y = (355*currentZoomScale*webViewContent.scrollView.zoomScale) + zoomPadding
          webViewContent.scrollView.contentOffset.x = webViewTitle.scrollView.contentOffset.x
      }else{
          webViewTitle.scrollView.contentOffset.y = (355*currentZoomScale*webViewContent.scrollView.zoomScale) + zoomPadding
          webViewTitle.scrollView.contentOffset.x = webViewContent.scrollView.contentOffset.x
      }
  }
  </code></pre>
  
  <p>Could any of these caused the diagonal scrolling to become buggy?</p>