0

I want to save in a file the text of UITextView with attributes (as Font, Color..).

I used the method:

pathtext = "...\nameFile.txt"
textView.text.writeToFile(pathtext, atomically: false, encoding: NSUTF8StringEncoding)

But it save only the text without attributes.

Which extension of the file should I use? If this isn't possibile, how can I save the text in other way?

Thanks for helping me.

Oxygen
  • 5
  • 5

1 Answers1

0

Try using :

textView.attributedText

to retreive the text content with its formatting attributes.

Giuseppe
  • 151
  • 1
  • 5