I'm trying to display image once it's been processed. Here's my code.
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "foodList", for: indexPath)
let dict = itemsArray?[indexPath.row]
cell.textLabel?.text = dict?["food_name"] as? String
var URLz = dict?["image_url"] as! String
Alamofire.request(URLz).response{ response in
if let data = response.data{
let image = UIImage(data:data)
cell.imageView?.image = image
}else{
print("Data is nil.")
}
}
return cell;
}
When I do the following; nothing gets displayed but table rows.