我在使用NSAttributedStringKey.attachment与NSAttachmentAttributeName时遇到了问题。相关代码如下:varkey:Any?if#available(iOS11,*){key=NSAttributedStringKey.attachment}else{key=NSAttachmentAttributeName}两件事之一正在发生。在我尝试使用此代码的实际位置(我自己设计的Cococapod,部署目标为iOS8,现在使用Xcode9构建),我收到错误消息:Type'NSAttributedStringKey'(aka'NSString')