I am trying to read a plist file which has Dictionary inside Dictionary
Example: ["Name":["Age":"Two", "Height":"Short"]]
This is how I am reading the file:
do {
let data = try Data(contentsOf: URL(fileURLWithPath: path))
let dataFromPlist = try PropertyListSerialization.propertyList(from: data, format: nil) as! [String:Any]
print(dataFromPlist)
} catch {
print(error)
}
But my result print(dataFromPlist) Is returning the following:
["Name": {
Age = 1;
Height = 1;
}]
How do I either convert the result of my current reading method or read the .plist file so that I get back exactly what I saved into it which is:
["Name":["Age":"Two", "Height":"Short"]]