I have followed loads of questions here but nothing seems to work.
I am using Swift3
in a Playground
. Running on El Capitan and Xcode 8.1.
You are using the wrong API, you need to load Data
rather than something in the file system.
if let url = Bundle.main.url(forResource: "levelList", withExtension: "plist"),
let plistData = try? Data(contentsOf: url ) {
let mydata = try! PropertyListSerialization.propertyList(from: plistData, options: [], format: nil) as! [String:Any]
}
To finally get the program working I used.
devices = NSArray(contentsOfFile: path) as! [AnyObject]
The issue with playground continuously running was solved by going to activity monitor and force quitting the process named com.apple.coresimulator which was identified as not responding. After doing this the playground ran instantly.