My class
class ScoreModel {
var playerId: Int?
var holeScores: [HoleScore]?
}
Other Class
class HoleScore {
var holeScore: Int?
}
I have these classes one is ScoreModel class which can have Array of objects of HoleScore
let scoreList = [ScoreModel]()
scoreList[0].holeScores![0].holeScore = 3
When i update or change holeScore for scoreList[0].holeScores[0] it changes it for all the scoreList[forAllIndexes].holeScores[0]. I just want to change the inner array prams for given index of outer array but it changes all the holeScore values when ever update.
scoreListfilled?HoleScoreinstance toholeScoresholeScoressize