title: How to use NSURLSession and loadHTMLString to load a website in a webView with CSS and JS?
body: <p>I am trying to preload websites, but I'm having trouble loading the CSS with loadHTMLString. The webView loaded from loadHTMLString looks like the CSS is missing from some parts. How do I make it so that in my NSURLSession, the CSS and HTML and everything else that makes up the website is loaded correctly?</p>
  
  <p>My function to extract all the data from the webpage.</p>
  
  <pre><code>var myData1: NSString!
  func loadURL(){
      let url = NSURL(string: "https://m.facebook.com")
      let reqURL = NSURLRequest(URL: url!)
      let session = NSURLSession.sharedSession().dataTaskWithRequest(reqURL){
          (data, response, error) in
          var myHTMLString = NSString(data: data, encoding: NSUTF8StringEncoding)
          self.myData1 = myHTMLString
      }
      session.resume()
      println("1 loaded")
  }
  </code></pre>
  
  <p>The button that will actually load the page in </p>
  
  <pre><code> @IBAction func loadWeb1(sender: AnyObject) {
      self.googlePlusWeb.loadHTMLString(myData1 as! String, baseURL: NSURL(string: "https://m.facebook.com"))
  }
  </code></pre>