I cant display image and text in a cell from my apple itunes api (I have the json). How can I do it?
func update(with item: StoreItem) {
mediaTitle?.text = item.name
artistName?.text = item.artist
print("(item.artworkURL)")
theImage?.image = UIImage(named: "Grey")
storeItemController.fetchItemArtwork(url: item.artworkURL) {
(image) in
if let image = image {
DispatchQueue.main.async {
self.theImage?.image = image
}
}
}
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "celly", for: indexPath) as! IntroCel let item = mediaObjs[indexPath.row] cell.update(with: item) cell.showsReorderControl = true return cell }