I placed a large text in a UITextView In Xcode in interface builder. Is it possible to assign different attributes (colors, headings, alignments..etc) to different parts of the string. Using MutableAttributedString
would not work for me since the string is longer than 5000 words, it would take ages to format it.
There is a simple way to do this. Outside Xcode :)
Open TextEditor
in MAC
and paste your text into it and format it as per your requirement and again copy it.
Now Add your UITextView
into your ViewController
in Storyboard
and make that textView Attributed.
Now Paste your formatted text there in the text field.
Check below screenshot for reference.
Hope this will help you.