Adding a reset button

Another basic question here,


I have followed a video on Youtube to make a simple card game app. after each round the players are awarded a point and I am now looking how I would make a reset button to return the scores to '0' once a player reaches 10.


Wondering if someone could point me in the direction of where to find this info rather than just giving me the code to do this action. I have created a button on the storyboard, If I drag this onto the .swift code area as an IBA link like I did with the other labels and buttons, would I create it as an action? or outlet?


Thanks for any help.


Danny

Accepted Answer

action or outlet are for different purpose.


Outlet : if you need to access the button's property, to change or get it, such as enabled, hidden, title or detect mouseEntered events…


action: connects an action to the button


In your case, basic need is action ; Outlet will not be needed, unless you want to disable the button until the player has scored some points.

Of course, yeah. Thank you.


Just found a part of the developer library that I thinks talks you through adding a reset button so will read through that tonight 😁


Danny

Adding a reset button
 
 
Q