M.Zul M.Zul - 1 year ago 75
Swift Question

How to print text from texfield in label on Viewcontroller.swift

I am actually trying to print whatever text in textfield to be displayed in label which is

being the textfield.

@IBOutlet weak var textf: UITextField!

@IBAction func enter(_ sender: Any) {
textDisplay.isHidden = false
textf.text = textDisplay.text

Answer Source

I understand that you want to display textField's text in the label after pressing on the button, right? Make sure that you connect all @IBOutlet and @IBAction and then, let change to textDisplay.text = textf.text

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download