swift - How do I display strings from an array vertically stacked? -
i trying take each string in array , list them in label 1 string per line. tried using joined method /n attempt make got next line literally puts /n in between each string. i'm sorry if happens duplicate unless i'm wording question wrong cant seem find answer. example of i'm looking for.
string[0] string[1] string[2] , on...
try this:
let array = ["the", "quick", "brown", "fox"] let string = array.joined(separator: "\n") joined returns new string concatenating elements of sequence, adding given separator (in case, line break) between each element in array.
that return this:
the quick brown fox ...and set yourlabel.numberoflines = 0
from apple's documentation:
the default value
numberoflines1. remove maximum limit, , use many lines needed, set value ofnumberoflines0.
Comments
Post a Comment