Answers for "SwfitUI Left side of mutating operator isn't mutable: 'self' is immutable"

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 "SwfitUI Left side of mutating operator isn't mutable: 'self' is immutable"

Code answers related to "Swift"

Browse Popular Code Answers by Language