📌  相关文章
📜  变异运算符的左侧不可变:'self' 是不可变的 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.204000             🧑  作者: Mango

代码示例1
mutating func nextQuestion(){ // add "mutating" before func to change value of variables from (the struct)
        if questionNumber + 1 < questions.count { // to count answered questions
            questionNumber += 1
        }else{
            questionNumber = 0
        }
    }