My code is trying to take to textfields and add them together to a total textfield. If I assign the values in viewdidload it works but as soon as I change the values the score textfield is not updated.
import UIKit
@IBOutlet var t11: UITextField!
@IBOutlet var t12: UITextField!
@IBOutlet var score: UITextField!
class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
acc()
}
func acc() {
let dx = ((t11.text! as NSString).integerValue + (t12.text! as NSString).integerValue)
print("its time",dx)
score.text = String(dx)
}