You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func getUsers() {
let URLSTring = "https://jsonplaceholder.typicode.com/posts"
AF.request(URLSTring).responseJSON { response in
if let JSON = response.data {
let str = String(decoding: JSON, as: UTF8.self)
//print(str)
let result = Mapper<ArrayResponse<ResponseModel>>().map(JSONString: str)
//self.userlist = Mapper<ResponseModel>().mapArray(JSONString: String(str))
let responseModel = Mapper<ResponseModel>().mapArray(JSONString: "\(String(describing: response.data))")
print(responseModel)
//let JSONString = Mapper().toJSONString(responseModel, prettyPrint: true)
// Convert JSON String to Model
//let responseModel = Mapper<ResponseModel>().map(JSONString: str)
// Create JSON String from Model
//let JSONString = Mapper<ResponseModel>().map(JSONString: str)
//let responseModel = Mapper<ResponseModel>().mapArray(JSONString: str)
}
//let users = Mapper<ResponseModel>().mapArray(JSONObject: data)
}
}
The text was updated successfully, but these errors were encountered:
exploitcrew
changed the title
it's still working ????? i am working o this but always show some error i don't no why
it's still working ????? i am working on this but always show some error i don't no why
Mar 8, 2022
func getUsers() {
let URLSTring = "https://jsonplaceholder.typicode.com/posts"
AF.request(URLSTring).responseJSON { response in
if let JSON = response.data {
let str = String(decoding: JSON, as: UTF8.self)
//print(str)
}
The text was updated successfully, but these errors were encountered: