I have a lot of text in the Privacy Policy, in the format .doc and html. How can I show this text in my program in UIViewController in UILabel for example?
Asked
Active
Viewed 167 times
0
-
3Does this answer your question? [Swift: Display HTML data in a label or textView](https://stackoverflow.com/questions/37048759/swift-display-html-data-in-a-label-or-textview) – Sander Saelmans Jul 29 '21 at 11:28
-
you can load that file to WKWebview directly – Hardik Thakkar Jul 29 '21 at 12:01
-
That's just the matter of converting an `NSAttributedString` object into a string, right? – El Tomato Jul 29 '21 at 13:14
1 Answers
0
For HTML use the answer given in the comment above.
For .doc documents, it's better to convert it to HTML and embed the HTML resources in your app. I would recommend to use third party tools to convert .doc to HTML, though, because they do usually a much better job than the applications that generate .doc documents.
You may use pandoc for example.
If the privacy document should be updatable in the app, you better convert .doc to html on the backend.
You can use CSS defined in your app to format it for your needs.

CouchDeveloper
- 18,174
- 3
- 45
- 67