013-json类型资源文件转化成数组
2016-12-18 本文已影响24人
紫荆秋雪_文
/// 路径
guard let path = Bundle.main.path(forResource: "main.json", ofType: nil),
let data = NSData(contentsOfFile: path),
let array = try? JSONSerialization.jsonObject(with: data as Data, options: []) as? [[String: Any]]
else {
return
}