Search code examples
swiftuilabelcarriage-return

How can I get my program to automatically perform a carriage return when string value superseeds the screen size?


I am making a quiz game that displays questions fetched from parse. I create the label programmatically, but stumble upon some issues when the string value is too long. Is there a way to make the label automatically print on a new line when it goes beyond the screen width?


Solution

  • I figured this out. I decided to make the frame a bit bigger and add in lines using the label.numberOfLines function. Now it returns perfectly.