title: Write to local html file in Swift
body: <p>I have some html code that I have receive from json. Now I have to write this html code to html document that is in my project and than show it in webView. How can I write my HTML code to my html file in my project.</p>
  
  <p>Here is in my content variable I have HTML code.</p>
  
  <pre><code>func getArticles() {
      //let id = "1018"
      let url = "http://www.salemkz.kz/inc/API/getArticles.php?idArticle=170"
      print(url)
      URLSession.shared.dataTask(with: URL(string: url)!) { (data, response, error) in
          if (error != nil) {
              print(error!.localizedDescription)
          }
          else {
              let jsons = try! JSONSerialization.jsonObject(with: data!, options: .allowFragments) as! [String: AnyObject]
              if let results = jsons["result"] as? [[String: AnyObject]] {
                  //print("got Result", results)
                  for result in results {
                      let content = result["content"] as? String
                      print(content!)
                  }
  
              }
  
          }
          }.resume()
  
  }
  </code></pre>
  
  <p>And I have to write this code to this html file (named "articles-1.html") : 
  <a href="https://i.stack.imgur.com/xS0h0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xS0h0.png" alt="enter image description here"></a></p>
  
  <p>How to do this ???</p>