I am writing an application in Swift 3.0 using xCode.
I have two steppers on the iPhone and when I press one of them, both text boxes are affected. I only want one text box to be affected. ]
Does it have something to do with sender.value? How do I state specifically when I want only one label to be affected?
Here is my code:
//the birthdate action that will increase or decrease the age
@IBAction func birthdateStepperAction(_ sender: UIStepper) {
//when the age stepper is pressed, the value is sent to the textbox
actualAgeLbl.text = String(sender.value)
}
//the weight action that will increase or decrease the weight
@IBAction func weightStepperAction(_ sender: UIStepper) {
//when the weight stepper is pressed, the value is sent to the textbox
actualWeightLbl.text = String(sender.value)
}
Here is before pressing the stepper:
Here is after pressing the stepper
Thanks in advance.
Probably you are connected with same
@IBAction
for two stepper. See below screen shot-