Swift Text Label

  1. 4 years ago

    Hi, I am new to swift and coding in general: How do you make sure that a text label can contain all the message that you want to display. Currently, the message is printing on one line and I cannot see the rest of the message.

  2. Edited 3 years ago by niutech

    Test it with println() function to see what is the text.

    For example:

    var myText = "This is a relatively long sentence but it could be longer if I keep typing..." println(myText)

    This will print the text from your variable into the console (of course, my example is using hard coded string, where you are probably referring to a ... for example the content from a text field that you have in a story board view. Either way, its the same. Just printl() it.

    I hope I understood u correctly

  3. Go to Storyboard -> Click un Label -> On the right side click on the 4th button ( it looks as an arrow - it calls attributes inspector) and down you have "Lines", there you can make the label to write text on more lines.

or Sign Up to reply!