Adding a line break to a UITextView

Viewed 103126

I have a UITextView that takes an NSString with formatting stringWithUTF8String. It is getting its values from a database and I want the text in the database to be rendered with breaks within the text. I tried using \n to do this but it gets rendered as text. Doing this in my information page of the app as straight text worked but I think the reason its not working when taking it from the database is because of the formatting.

Any suggestions?

12 Answers

Append a character("\n") in the string

var logs = "this is first Line" self.logs.append(Character("\n")) self.textView.text = self.logs

Related