i want my app to do this: when a button is pushed, it will add the specified number and the number that is in the label then show the total of the numbers in the label. Please help!
Pretty straightforward.
Read label 1 and convert to Int of Float, whatever it is.
Add the new number to it
Write to label.
Read label 1 and convert to Int of Float, whatever it is.
Add the new number to it
Write to label.
Code Block @IBOutlet weak var label : UILabel! // In the IBAction of the button var value = Int(label.text!) ?? 0 // Get the label value content, if an Int is expected value += specifiedValue // add the specified value label.text = "\(value)"