iOS Objective C: Display RTF document

前端 未结 2 1032
栀梦
栀梦 2021-02-20 12:21

I want to show a RTF document in a view. This document will be developed in Microsoft Word and will contains images.

What is the best way to do this using standard rout

2条回答
  •  醉酒成梦
    2021-02-20 13:06

    If you need to do this in Swift instead of Obective-C here's a Swift equivalent of @pmf's answer as a function you can call.

    func loadRTFDocument() {
        let urlPath =  NSBundle.mainBundle().pathForResource("TermsOfUse", ofType: "rtf")
        let url = NSURL.fileURLWithPath(urlPath!)
        let request = NSURLRequest.init(URL: url)
        self.webView.loadRequest(request)
    }
    

提交回复
热议问题