Simple string return value in function not working?

Swift 3.0......


func labelConv() -> String {

var thisLabel = String()

if (movedPiece == "A1") { thisLabel = A1Label.text! }

print (thisLabel)

return thisLabel

}



print (labelConv())

A1Label.text = labelConv()



thisLabel is BLANK WHY? It is a chess emojii I am passing... but I do not think that will make a difference.

And the print of the function is BLANK

And A1Label.text is obviously BLANK as well.....

Why cant I get a value in thisLabel?

Now I dont know if it is a stupid error on my part or Something with Swift 3.0

Thanks for any help. This is frankly a little embarassing, but I cant seem to figure it out.

Where is the chess emoji being put into A1Label.text? Note that this line:


A1Label.text = labelConv()


is either going to do nothing (if movedPiece is "A1") or set A1Label.text to the empty string (if not "A1"). This seems suspicious.

I was trying to delete this sorry....


As is always the case. it had nothing to do with the return value or the function....


And everything to do with touches, began, touches moved, touches ended....

Simple string return value in function not working?
 
 
Q