I have this code for download data:
let parameters = [
"NationalCode": "06090632",
"password": "0012"
]
let url = "http://android/home/login"
Alamofire.request(url, method: .post, parameters: parameters, encoding: URLEncoding.httpBody).responseJSON { response in
if let data = response.data {
let json = String(data: data, encoding: String.Encoding.nonLossyASCII)
print(json)
self.lbl1.text=json
}
}
I have this result that is true:
Optional("{\"id\":\"3\",\"name\":\"jac\"}")
Now I want to loop each item of result. I want to print "id" in one label and "name" in another label. How can I do this? (I am new in Swift)