Skip to main content
added 294 characters in body
Source Link
Bhavin Bhadani
  • 22.4k
  • 10
  • 81
  • 109

try this....

When you receive response,get the whole array of dictionary

if let arr = response["data"] as? [[String:String]] {
      YourArray = arr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id 

And don't forget to set number of rows

 override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    // #warning Incomplete method implementation.
    // Return the number of rows in the section.
    return YourArray.count
}

try this....

When you receive response,get the whole array of dictionary

if let arr = response["data"] as? [[String:String]] {
      YourArray = arr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id

try this....

When you receive response,get the whole array of dictionary

if let arr = response["data"] as? [[String:String]] {
      YourArray = arr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id 

And don't forget to set number of rows

 override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    // #warning Incomplete method implementation.
    // Return the number of rows in the section.
    return YourArray.count
}
deleted 6 characters in body
Source Link
Bhavin Bhadani
  • 22.4k
  • 10
  • 81
  • 109

try this....

When you receive response,get the whole array of dictionary

if let arr = responseObject["data"]response["data"] as? [[String:String]] {
      YourArray = arr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id

try this....

When you receive response,get the whole array of dictionary

if let arr = responseObject["data"] as? [[String:String]] {
      YourArray = arr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id

try this....

When you receive response,get the whole array of dictionary

if let arr = response["data"] as? [[String:String]] {
      YourArray = arr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id
edited body
Source Link
Bhavin Bhadani
  • 22.4k
  • 10
  • 81
  • 109

try this....

When you receive response,get the whole array of dictionary

if let arr = responseObject["data"] as? [[String:String]] {
      YourArray = idsarr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id

try this....

When you receive response,get the whole array of dictionary

if let arr = responseObject["data"] as? [[String:String]] {
      YourArray = ids  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id

try this....

When you receive response,get the whole array of dictionary

if let arr = responseObject["data"] as? [[String:String]] {
      YourArray = arr  
      // Define YourArray globally
}  

Then in tableview cell,cellForRowAtIndexPath method

if let name = YourArray[indexpath.row]["name"] as? String{
      label.text = name
}
//Same You can done with id
Source Link
Bhavin Bhadani
  • 22.4k
  • 10
  • 81
  • 109
Loading