I am working a Swift homework assignment, where when I click on a button, the user text moves to the label. For some reason, it is not working. I also have this exception error here:
Exception NSException * "[<HelloWorld.ViewController 0x160b08920> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key button." 0x0000600003b2e760
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBOutlet var textLabel: UILabel!
@IBOutlet var textField: UITextField!
@IBAction func moveText(_ sender: Any) {
textLabel.text = textField.text
textField.text = ""
}
}