Add text to textview in Swift
19,249
thePeople.text = thePeople.text+"NewText"
or shorter
thePeople.text += "NewText"
Author by
Heinevolder
Updated on June 04, 2022Comments
-
Heinevolder almost 2 years
How do i add text to a label or tableview, instead of updating the label/tableview?
var personArray: [Person] = [ Person(name: "Heine", sex: "Guy"), Person(name: "Magnus", sex: "Girl"), Person(name: "Sarah", sex: "Girl") ] @IBOutlet weak var thePeople: UILabel! func updatePeople() { for peop in personArray{ thePeople.text = "" } }