This is getting frustrating! Making one UIButton enable another button and change its state to .isHidden to false should be relatively simple. I have been wrestling with this dilemma for way too long and need some help.
class Buttons: Numbers {
var button = UIButton()
func unhideBtn (sender: Any?)
{
button.isHidden = false
button.isEnabled = true
}
/* generate button sends data to labels
and should enable buttons 1 - 5
*/
@IBAction func save(_ sender: UIButton) {
button = sender.self
savedNumbers.arrayStuff()
print("just left the saveButton")
}
@IBAction func generateButton(_ sender: UIButton)
{
button.isHidden = false
purge()
if (buttonPressed == false) { errorMsg(tag: sender.tag) }
else { sortBallNumbers(lottoArray: lotto, bonusArray: bonus) }
}
I have tried numerous versions of buttonName.isHidden and buttonName.isEnabled but alas no joy. Everthing I have researched all recommend to "simply" use the button's name. But when I try to use the "save" button and set it to .isHidden or .isEnabled but I get errors like:
Value of type '(UIButton) -> ()' has no member 'button' for
saveNumbers.editButtonItem = editButtonItem.isEnabled
Value of tuple type '()' has no member 'isHidden'
let button = saveNumbers(<sender: UIButton)
button.isHidden = false
This can't be this difficult can it?