I have just updated to Xcode 9 and converted my app from swift 3 to swift 4 and get this errors. how i can fix this?
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
}
}
And get this Error
Cannot convert value of type 'NSAttributedString.DocumentAttributeKey' to expected dictionary key type 'NSAttributedString.DocumentReadingOptionKey'