You have to use this code in try catch like below..
if let rtf = NSBundle.mainBundle().URLForResource("rtfdoc", withExtension: "rtf") {
do {
let attributedString = try NSAttributedString(fileURL: rtf, options: [NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType], documentAttributes: nil)
textView.attributedText = attributedString
textView.editable = false
print(attributedString)
} catch let error as NSError {
print(error.localizedDescription)
}
}
solved Update code to swift 2 [closed]