Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
abdulah binmadi
810 PointsI wanna have a new label with custom value every time the user hits the button
Hi I wanna have a new label with custom value every time the user hits the button so for example: I have a (text box) when the user hits the button (add) there will be a new label under the (text box) with the value that the user entered ,,
I was working on a solution but I seemed to have some problems , my solution was to have a big label and every time the user hits the button I'll get to a new line then write the new value but I had some troubles with that ! so can any one please give me a way to do that ?!
here is how I tested my idea (label called label and the text called text)the names are different from here but it has the same idea label = "\n (text)"
1 Answer
Robin Malhotra
14,883 PointsYou'll probably have to make a scrollview, increase the content size's height and keep adding labels there.
abdulah binmadi
810 Pointsabdulah binmadi
810 PointsI had this idea before but my problem is how to keep adding the labels -> I'm a beginner
Robin Malhotra
14,883 PointsRobin Malhotra
14,883 PointsSomething like this(I don't have that much swift experience,so I'll go with objC):