I am finishing a small project to learn Swift but there is a small problem in putting more variables in output .
@IBOutlet weak var Nome: UITextField!
@IBAction func CalcularIMC(_ sender: AnyObject) {
imc = ((p * 200) / (a * a)) * 100 / 2
var str = "";
if imc < 16
{
str = NSString(format: "O seu IMC é %.2f, Peso Abaixo", imc) as String
lblresultado.backgroundColor = UIColor.orange
}
lblresultado.text = str;
Some parentheses are certainly missing but it was just for show. My problem is here:
(format: "O seu IMC é %.2f, Peso Abaixo", imc)
In this text I also want to show the Nome
variable that is at the beginning of the code I showed.