title: Xcode 9.1 Swift 4, unable to compile with NSDocumentTypeDocumentAttribute if "if #available" is used
body: <p>Hi I have app with is targeting iOS8.2 in deployment target setting. I tried to convert app to swift 4 from swift3. It works, but is not working in simulator of iPhone 5s iOS 8.4. Problem is this:</p>
  
  <pre><code>cell.lblHeader.attributedText = try NSAttributedString(data: htmlData, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil)
  </code></pre>
  
  <p>So i tried this:</p>
  
  <pre><code>if #available(iOS 11, *){
       cell.lblHeader.attributedText = try NSAttributedString(data: htmlData, options: [NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil)
  }
  if #available(iOS 8.4, *){
       cell.lblHeader.attributedText = try NSAttributedString(data: htmlData, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil)
  }
  </code></pre>
  
  <p>But I'm unable to compile this code Xcode is displaying exception for iOS 8.4 branch:</p>
  
  <pre><code>Cannot convert value of type 'NSAttributedString.DocumentAttributeKey' to expected dictionary key type 'NSAttributedString.DocumentReadingOptionKey'
  </code></pre>
  
  <p>I have opinion about setting base sdk to 8.x but I don't found ho to do it. In build setting I'm able to set base sdk only to 11.x version. </p>
  
  <p>I will be thankful for every idea.</p>