So, I'm making an app that after having the user select their level of education from a picker view and if they select college education a number of buttons are supposed to appear saying 'associates degree' 'bachelor's degree' and 'master's degree'. I know I need to make an if statement like this:
func pickerView(pickerView: UIPickerView, row: Int, forComponent component: Int) -> String! {
if educationLabel.text == educationLevel {
return education[row]
If row = "College Graduate"
//Hidden buttons code
Else
//Hidden buttons
}
but I'm unsure of how to write the code that keeps all three buttons hidden as every example I've come across only had one button. I'm assuming it would be similar to what is suggested here: how to hide/show a button in swift with buttons two and three added on but I am using Swift 4 and am unsure how much of the answer I can use since it uses Swift 3. Can someone please help me out?