I am new to xcode and swift. I am running xcode 10 and swift 4.2.
I need for a UIButton to enable other buttons and I and running in circles
I want to use the generate button to enable the buttons below it. I have tried using buttonName.isEnabled = false but I get an error. Any assistance would be grteatly appreciated. Thanks in advance
All this is not very clear. You should clarify and show the complete code of the viewController if you want some help.
When you tap the button, you call generateButton (a strange name, it does not generate anything) and want to change a button (enable / disable). Is it this ?
What are those buttons below generate ?
Is the button editButtonItem or something elese ?
What is fetch function ?
What is buttonPressed ?
If my understanding is correct, you should:
@IBAction func generateButton(_ sender: UIButton)
{
editButtonItem.isEnabled = !editButtonItem.isEnabled // Toggle between enabled and disabled
if (buttonPressed == false) { errorMsg() }
else { fetch() }
}