how to add user defined label

I have no idea how to frame this question correctly.


I have created a "Tap Counter" app, where i press one button to add 1 to my counter, and press another button to minus 1.

I have added four of these into the one page, so i can play a 4 player card game, and we can each keep track of the score on the app.


at the moment, i am stuck using a label saying player 1, player 2, etc for each counter.
i want to know how i can enter a box, so when i open the app, i can type in a name, and that name will stay present next to the counter.

i want to do this to each counter.


Also, could you be detailed with replies.

Thankyou for your help 🙂.

Not sure to understand what is exactly your problem.


Here's my advice.


In Interface Builder, you create 4 labels that you position close to each counter (a text field I assume)

connect these labels to the code (usually view controller) and give each IBOutlet a name ; eg.


@IBOutlet weak var gamer1: UILabel!

@IBOutlet weak var gamer2: UILabel!


when you open the app, you ask for the names of the players

And you set the label with

gamer1.text = name1

how to add user defined label
 
 
Q