title: Swift - WKWebview takes a lot of time to load url
body: <p>My mobile app uses Swift 3/ Xcode 8.3.2 and iOS 10. I have used webview/WKWebView to render website in mobile app. Because Xcode doesn't provide functionality to insert wkwebview, I have associated webview using Xcode but then programatically assigning WKWebview to it and rendering site in it. The web page loads very fast when I use WIFI (1 second) but takes approximately 10 seconds when using internet (mobile network). Any clue?</p>
  
  <p>class WebSiteViewController: UIViewController, WKNavigationDelegate, WKUIDelegate{</p>
  
  <pre><code>var webURL: String? = nil
  var alertRequestURL: String? = nil
  var alertHeader: String? = nil
  var websiteView: WKWebView!
  var spinner: UIActivityIndicatorView!
  @IBOutlet weak var webView: UIView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      navigationController?.interactivePopGestureRecognizer?.isEnabled = false    
      let backButton = UIBarButtonItem()
      //self.navigationController?.navigationBar.backItem?.title = ""
      //self.navigationController?.navigationBar.topItem?.title = ""
      //self.navigationController?.navigationBar.topItem?.backBarButtonItem = backButton
  
      if let url = URL(string: webURL!) {
        let request = URLRequest(url:url)
        websiteView.load(request)
      }
  
      self.spinner  = UIActivityIndicatorView()
      self.spinner.center = CGPoint(x: UIScreen.main.bounds.width/2, y: UIScreen.main.bounds.height/2)
      self.spinner.activityIndicatorViewStyle = .gray
      self.spinner.hidesWhenStopped = true
      self.view.addSubview(spinner)
      self.spinner.startAnimating()
  }
  
  override func loadView() {
      super.loadView()
      self.websiteView = WKWebView(frame: self.webView.frame)
      self.websiteView.uiDelegate = self
      self.websiteView.navigationDelegate = self
      self.view = self.websiteView
  }
  </code></pre>