title: How do I create a NSAttributedString from HTML in Swift 3?
body: <p>I have an HTML string and I want to make an <code>NSAttributedString</code> out of it. This is fairly simple in Objective-C:</p>
  
  <pre><code>NSData* html;
  [[NSAttributedString alloc] initWithHTML:html documentAttributes:nil];
  </code></pre>
  
  <p>This should be fairly simple in Swift as well, but I apparently can't get it right. I have this:</p>
  
  <pre><code>import Foundation
  import AppKit
  
  let html: Data = ...
  let str = NSAttributedString(HTML: html, documentAttributes: nil)
  </code></pre>
  
  <p>However, this causes an error:</p>
  
  <pre><code>error: repl.swift:5:11: error: ambiguous use of 'init(HTML:documentAttributes:)'
  let str = NSAttributedString(HTML: html, documentAttributes: nil)
            ^
  
  found this candidate
  found this candidate
  </code></pre>
  
  <p>This is from the REPL, but Xcode gives the same error. Of course, "found this candidate" refers to <code>&lt;unknown&gt;:0</code>, so I have no idea where the ambiguity is coming from.</p>
  
  <p>How do I create a <code>NSAttributedString</code> from HTML data in Swift 3.0?</p>