In my app I'm facing one trouble, my requirement is I want to show text in single line, but response which was coming from API is like:
"Hi
Hello
How Are You"
How to convert this and display in single line in UILabel
In my app I'm facing one trouble, my requirement is I want to show text in single line, but response which was coming from API is like:
"Hi
Hello
How Are You"
How to convert this and display in single line in UILabel
var newString = myString.components(separatedBy: CharacterSet.newlines).joined(separator: " ")
Then you can bind that newString to UILabel.