[Solved] How to use *.RTF files in WebView?

You want to look at NSAttributedString. This class provides direct import/export interchange with RTF files. For iOS, the reference you want is here: https://developer.apple.com/library/ios/documentation/UIKit/Reference/NSAttributedString_UIKit_Additions/index.html For OS X, the reference you want is here: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/ 1 solved How to use *.RTF files in WebView?

[Solved] Update code to swift 2 [closed]

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]