0

I have two textfield and one label, say Txt1 and Txt2 and result, i want to add both input of text field and display it on one label in same view controller.
So how can i do this? Thank you.

Ilesh P
  • 3,940
  • 1
  • 24
  • 49
Arjun Ker
  • 11
  • 4

2 Answers2

1

Try this :

    @IBOutlet var label: UILabel!
    @IBOutlet var txt2: UITextField!
    @IBOutlet var txt1: UITextField!

    //Setting value t label

    label.text = txt1.text! + txt2.text!
Bhagyalaxmi Poojary
  • 1,213
  • 1
  • 12
  • 17
0
 yourLabel.text = [NSString stringWithFormat:@"%@%@",txtField1.text,txtField2.text];
user3182143
  • 9,459
  • 3
  • 32
  • 39