When i get results from web Service JSON comes like this :
responseString = "\{\\\"code\\\":\\\"OK\\\",\\\"description\\\":\\\" DOĞRULAMA KODUNUZ 6806\\\"}\"
but When I print it.
let responseString = NSString(data: data!, encoding: NSUTF8StringEncoding)
print("responseString = \(responseString)")
I see this response:
responseString = Optional("{\"code\":\"OK\",\"description\":\"DOĞRULAMA KODUNUZ 6806\"}")
And i want to parse it. But I get format error. My code is below:
let responseJson = JSONStringify(responseString!)
let json: AnyObject? = responseJson.parseJSONString
let code = (json as! NSDictionary)["code"] as! String
let description = (json as! NSDictionary)["description"] as! String
print("code: \(code)")
print("description: \(description)")
Thank you for your help.