I am getting error like "ambiguous reference to member subscript" in a dictionary which may contains array type values, when I try to access array type values then getting error. Please check below code.
var occupations = [
"Malcolm": "Captain",
"Kaylee": "Mechanic",
"Layme": ["Engineer", "Docter"]
] as [String : Any]
occupations["Jayne"] = "Public Relations"
var arrOfLayme = occupations["Layme"] as! Array //getting error here, If I use NSArray instead of array all will work as expacted
print(valueOcc[0])
when I used NSArray type this code going well as below line, I want to do in pure swift way, don't want to add Objective-c.
var arrOfLayme = occupations["Layme"] as! NSArray