What you have to do is to attach an IBAction to your UITextField Sent Events Editing Changed:
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var strLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@IBAction func editingChanged(sender: UITextField) {
strLabel.text = sender.text
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…