如何在按钮数组中隐藏多个按钮?我需要这样做:如果问题的数量少于按钮数组,那么应该隐藏具有附加功能的按钮。
@IBOutlet var firstButton: UIButton!
@IBOutlet var secondButton: UIButton!
@IBOutlet var thirdButton: UIButton!
@IBOutlet var fourthButton: UIButton!
@IBOutlet var fifthButton: UIButton!
@IBOutlet var sixthButton: UIButton!
func generateQuestions() -> Question {
// MARK: - Questions
let questionOne = Question.init("questionOne?")
let questionTwo = Question.init("questionTwo")
// MARK: - Answers
let answerOne = Answer.init("answerOne", type: .python, nextQuestion: nil)
let answerTwo = Answer.init("answerTwo", type: .next, nextQuestion: questionTwo)
let answerThree = Answer.init("answerThree", type: .next, nextQuestion: nil)
let answerFour = Answer.init("answerFour", type: .next, nextQuestion: nil)
let asnwerFive …Run Code Online (Sandbox Code Playgroud)