I receive data from php file with this format:
{"object:value", "object2:value2"...}
{"object:value", "object2:value2"...}
I know how to parse this in Swift2 using next code repeatedly changing separatedBy string:
if let url = NSURL(string: strURL), let data = NSData(contentsOfURL: url) {
let strResult = NSString(data: data, encoding: NSUTF8StringEncoding)
}
tareas = strResult!.componentsSeparatedByString(",")
But I want parse this more easily. I have read others questions and answers but the format to parse was:
[
{"person": {"name":"Dani","age":"24"}},
{"person": {"name":"ray","age":"70"}}
]
And my data is different. How can I do this more easily?
Thanks!