> Iam trying to insert values into dictionary . I tried 2 ways one in which the 2 variables are used and other in which i directly pass the value inside dictionary . Both are not working
for index in 0..<classes.count{
var classification = classes[index].className
var score = classes[index].score
//not working
self.classificationDictionary[classification] = score
//not working
self.classificationDictionary[classes[index].className] = classes[index].score
}
After the closure this seems to work. I dont understand how to append values into dictionary .
classificationDictionary["abc"] = 131
print("dictionary : ",classificationDictionary)
print(classificationDictionary.count)