You are adding the text (String
) values to each other in the label text. You should do this instead:
guard let num1 = Int(textField1.text),
let num2 = Int(textField2.text),
let num3 = Int(textField3.text) else {
return
}
let sum = num1 + num2 + num3
label.text = str+sum