Created
April 11, 2016 15:15
-
-
Save joeltrew/5072f32ec66fbdb6b16df2bcc3715455 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var results = [NSDictionary]() | |
if let path = NSBundle.mainBundle().pathForResource("output", ofType: "json") { | |
do { | |
let jsonData = try NSData(contentsOfFile: path, options: NSDataReadingOptions.DataReadingMappedIfSafe) | |
do { | |
let jsonResult: NSDictionary = try NSJSONSerialization.JSONObjectWithData(jsonData, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary | |
if let londonEvents = jsonResult["WALES"] as? [[String: AnyObject]] { | |
for event: [String: AnyObject] in londonEvents { | |
results.append(event) | |
} | |
} | |
} catch {} | |
} catch {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment