小编Mik*_*lin的帖子

如何隐藏几个按钮是按钮数组?

如何在按钮数组中隐藏多个按钮?我需要这样做:如果问题的数量少于按钮数组,那么应该隐藏具有附加功能的按钮。

@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)

uibutton ios swift

1
推荐指数
1
解决办法
155
查看次数

标签 统计

ios ×1

swift ×1

uibutton ×1