I am having trouble trying to add a number inputted in a text box to add itself.
I have created two outlets - one where to input the number and the second where the answer shows. I also created a outlet action for the button where to submit it.
Now when I input a number, since its a string its a string it just puts it together like this. Enter number 10, outcome is 1010.
It does not add itself. I want an outcome of 20.
@IBOutlet weak var inputField: UITextField!
@IBAction func addButton(sender: AnyObject) {
addAnswerBox.text = inputField.text + inputField.text
}
@IBOutlet weak var addAnswerBox: UITextField!
}