My server return some text contain \n
. I expect \n
to print a new line but it does not work. Swift just printed the text and \n
too. But if I declare string on my local place, e.g.
let test = "This is a \nbook"
It works! Swift and UILabel
prints a new line, e.g.
This is a
book
Then my code i set
myLabel.numberOfLines = 0
It doesn't work as expected, but the local variable works.
I don't understand why though.