I am trying to hide a button called "itemOneDelete" when a label ("itemOneLabel") on my View Controller is empty, by using an 'if' loop to change the visibility of the button to "alpha = 0" by using the following code:
However I am receiving the following error for the itemOneDelete.alpha = 0 line and I can't seem to fathom why.
Code Block @IBAction func itemOneDelete(_ sender: UIButton) { if self.itemOneLabel.text == "" { itemOneDelete.alpha = 0 }
However I am receiving the following error for the itemOneDelete.alpha = 0 line and I can't seem to fathom why.
I have also tried replacing line three with the following syntax, however I received a similar error:Value of type '(UIButton) -> ()' has no member 'alpha'
Code Block itemOneDelete.hidden = true
Can anyone explain why I am getting this error and how to resolve it please?Value of type '(UIButton) -> ()' has no member 'hidden'