Skip to content

it's still working ????? i am working on this but always show some error i don't no why  #321

Description

@akshaychauhandev

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)
    
    
    
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions