I am facing a problem when scrolling from top to bottom of my tableview
. The reusable cell shows old image until new image download is completed.
It sh
You can set your default image in ItemTableViewCell
when the cell is initialized
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
self.image= defaultImage
}
Edit
func configureCell(iteminfo:ItemInfo , img1 : UIImage? , img2 : UIImage? ){
if img1 != nil {
imageViewItemPic.image = img1
}
else{
print("hi1")
imageViewItemPic.image = UIImage(named: "resto-placeholder.png")
imageViewItemPic.setImageFromURL(url: iteminfo.imageUrl!)
}
if img2 != nil {
imageViewCookerProfilePic.image = img2
}
else{
imageViewItemPic.image = UIImage(named: "resto-placeholder.png")
imageViewCookerProfilePic.setImageFromURL(url: iteminfo.cookerProfilePicUrl!)
}
labelItemHeading.text = iteminfo.heading
labelItemDescription.text = iteminfo.description
}