In this fiunction I am trying to change the title of a button when the button is pressed.
@IBAction func changeUnits(_ sender: Any)
{
metricUnits = !metricUnits
let cState = UIControlState.normal;
if (metricUnits)
{
unitsButton.setTitle("Metric", for: cState) // this line has error : Editor placeholder in source file
}
else
{
unitsButton.setTitle("English", for: cState) // this line has error : Editor placeholder in source file
}
}
What am I doing wrong? Is this a bug?
Thx in advance