Answers for "left side of mutating operator isn't mutable"

0

Left side of mutating operator isn't mutable: 'self' is immutable

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
        }
    }
Posted by: Guest on January-26-2021

Code answers related to "left side of mutating operator isn't mutable"

Code answers related to "Swift"

Browse Popular Code Answers by Language