//json parsing from file helper class
class helperClass
{
class func jsonParsingFromFile(pathToFile:NSString)-> NSArray
{
let data : NSData = try! NSData(contentsOfFile: pathToFile as String, options: NSDataReadingOptions.DataReadingMapped)
let jsonResult: AnyObject = try! NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers)
print(">>>>>>\(jsonResult)");
let dict: NSArray! = jsonResult.valueForKey("deviceInfoList") as! NSArray
print(">>>>dict>>\(dict.valueForKey("al_mac").objectAtIndex(0))");
return dict
}
}
main()
{
let path: NSString = NSBundle.mainBundle().pathForResource("days", ofType: "json")!
arrDict = helperClass.jsonParsingFromFile(path)
}