1
Just add the space in the string concatenation:
var texto1 = "" + Enter.text!
var texto2 = "" + Enter1.text!
myLabel.text = texto1 = + " " + texto2
1
1
Just add the space in the string concatenation:
var texto1 = "" + Enter.text!
var texto2 = "" + Enter1.text!
myLabel.text = texto1 = + " " + texto2
0
Another way:
myLabel.text = "\(Enter.text!) \(Enter1.text!)"
myLabel.text = text1.text! + " " + text2.text!
Browser other questions tagged swift swift-playground
You are not signed in. Login or sign up in order to post.
OPS! did not work, in practice it only works if when writing the first name gives a space. The output of the two names comes out correctly
– An. Jorge
I changed the answer, test it like I just did there.
– Allan Andrade
It didn’t work, The Xcode says: Unary Operator cannot be separated from its operand.
– An. Jorge
myLabel.text = Enter.text! + " " + Enter1.text!
– Leo Dabus
By convention Voce should name its variables starting with lower case letter.
myLabel.text = enter.text! + " " + enter1.text!
– Leo Dabus
It worked, at first it gave an error by not having the text and text1 variables in any other part of the code replaced by underscore and gave _ = " " + Enter.text! _ = " " + Enter1.text! Thanks
– An. Jorge