Hey guys I'm currently trying to loop through a plist that is set up like this:
The code I'm using:
letterPoints = NSDictionary(contentsOfFile: Bundle.main.path(forResource: "LetterPoints", ofType: "plist")!)
for (myKey, myValue) in letterPoints {
for (key, value) in myValue as NSDictionary {
let x = value["Item 0"] as NSNumber
let y = value["Item 1"] as NSNumber
// lastPoint: CGPoint = CGPoint(x: x.integerValue, y: y.integerValue)
println("x: \(x); y: \(y)")
}
}
However I am getting and error in the first line of the loop: for-in loop requires 'NSDictionary?' to conform to 'Sequence'; did you mean to unwrap optional?
I took the code from loop through nested NSDictionary in plist using swift and it seems to be the same structured plist as mine so im not sure why it isn't working. What is the best way to loop over my plist?