Can I decode a JSON file in Swift? I searched a lot in Google, but couldn't find anything.
I have a next code:
let urlPath = "http://example.com/json"
let url = NSURL(string: urlPath)
let session = NSURLSession.sharedSession()
let task = session.dataTaskWithURL(url!, completionHandler: {
data, response, error -> Void in
if (error != nil) {
println(error)
} else {
let jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: nil) as NSDictionary
println(jsonResult)
}
})
task.resume()
And as result I gave the next:
\U0440\U0435\U0434\U0441\U0442\U0430\U0432\U043b
I know that this JSON is encoded. How can I decode it and use?