title: How to decode html formatted text in Swift 3
body: <p>I want to display the below html text in iOS app</p>
  
  <pre><code>&lt;p&gt;&lt;span style="color: #000000;"&gt;Experience royalty in all its splendor&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000000;"&gt; An address that is a possession of pride&lt;/span&gt;&lt;/p&gt;
  </code></pre>
  
  <p>I tried with NSAttributedString and appending font in html string, however nothing works</p>
  
  <pre><code>let st:String = pjt.value(forKey: "description") as! String // Original content from API - "&amp;lt;p&amp;gt;&amp;lt;span style=&amp;quot;color: #000000;&amp;quot;&amp;gt;Experience royalty in all its splendor&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;span style=&amp;quot;color: #000000;&amp;quot;&amp;gt; An address that is a possession of pride&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;........"
  
  let desc:Data = st.data(using: String.Encoding.utf8, allowLossyConversion: true)!
                  //st.data(using: String.Encoding.utf16)!
              do {
                  let attrStr = try NSAttributedString(data: desc, options: [NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType], documentAttributes: nil)
                  print("Attr STr \(attrStr)")
                  self.textView.attributedText = attrStr;
              }
  </code></pre>
  
  <p>It's also not working in web view with <code>self.webView.loadHTMLString(st, baseURL: nil)</code></p>
  
  <p><strong>Updated</strong></p>
  
  <p>Textview or webview or label all shows the same plain html string <code>&lt;p&gt;&lt;span style="color: #000000;"&gt;Experience royalty in all its splendor&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000000;"&gt; An address that is a possession of pride&lt;/span&gt;&lt;/p&gt;</code></p>
  
  <p>Any help? </p>
  
  <p><strong>Note</strong>: Swift 3</p>
  
  <p>Thanks!</p>