title: NSAttributedStringKey.attachment versus NSAttachmentAttributeName
body: <p>I'm having problems with NSAttributedStringKey.attachment versus NSAttachmentAttributeName. Here's the relevant code:</p>
  
  <pre><code>    var key: Any?
      if #available(iOS 11, *) {
          key = NSAttributedStringKey.attachment
      }
      else {
          key = NSAttachmentAttributeName
      }
  </code></pre>
  
  <p>One of two things are happening. In the actual place where I'm trying to use this code (a Cococapod of my own design, with a deployment target of iOS 8 and now building with Xcode 9), I get an error:</p>
  
  <pre><code>Type 'NSAttributedStringKey' (aka 'NSString') has no member 'attachment'
  </code></pre>
  
  <p>Or, if I just make a new example project and set the deployment target at iOS 8, I get:</p>
  
  <pre><code>'NSAttachmentAttributeName' has been renamed to 'NSAttributedStringKey.attachment'
  </code></pre>
  
  <p>This is not the behavior I'd expect with <code>#available</code>. Thoughts?</p>