I am trying to code an if statement to display text on my label but I want to use two text field variables. It shows no error but when I press the button on the simulator or device the label still shows up blank.
I am just starting coding so I'm guessing it has an easy answer.
Here is my coding:
@IBOutlet var LblResult: UILabel!
@IBAction func Calculate(_ sender: UIButton)
{
let Variable1 = (Variable1.text! as NSString).floatValue
*//var 1 and 2 are text fields*
let Variable2 = (Variable2.text! as NSString).floatValue
if Variable1 > 15 && Variable2 < 30{
LblResult.text = "TEXT"
}
}