私はXcode 9に更新し、swift 3からswift 4にマイアプリを変換してこのエラーを取得しました。どのように私はこれを修正することができます?'NSAttributedString.DocumentAttributeKey'型の値を予想される辞書キータイプ 'NSAttributedString.DocumentReadingOptionKey'に変換できません
func displayText() {
do {
if url.pathExtension.lowercased() != "rtf" {
let fileContent = try String(contentsOf: url)
text.text = fileContent
} else { // Is RTF file
let attributedString = try NSAttributedString(url: url, options: [NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType], documentAttributes: nil)
text.attributedText = attributedString
text.isEditable = false
}
}
、このエラーを取得
型の値が期待辞書のキータイプに 'NSAttributedString.DocumentAttributeKey' 'NSAttributedString.DocumentReadingOptionKey'
迅速4では