I have a custom model
like bellow:
struct ContentModel {
var id: Int64?
var parentID: Int64?
var subject: String?
var langId: String?
var isSelected: String?
var identifier: String?
var title: String?
var count: Int64?
var selectAll: String?
var textSelectAll: String?
}
And:
struct SectionModel {
var expand:Bool
var title:String
var content:[ContentModel]
}
How can I update a specific item from above model?
I am using from bellow code:
for resRoot in displayListCourseFilter{
for resSub in resRoot.content{
if pId == resSub.parentID{
resSub.selectAll = "true"
resSub.isSelected = "true"
}
}
}
But say me:
Cannot assign to property: 'resSub' is a 'let' constant
NOTICE: All of my variables are var
.