Hi Brian,
I'm trying to run the fetchJSON() func in the controller file or should I run it in the cell file?
In the cell file it has...
var imageView = UIImageView(image: xxx)
in the controller file I have the fetchJSON() func with JSONDecoder()...
self.collectionView?.reloadData()
which send it to collectionView cellForItemAt...
But I'm getting this error...
Value of type 'UICollectionViewCell' has no member 'imageView'
when using this in the cellForItemAt func
cell.imageView.sd_setImage(with: url, completed: nil)
I'm having a hard time figuring out if I should run the fetchJSON in the controller file or the cell file.
Just need to override the var imageView = UIImageView(image: xxx) with cell.imageView.sd_setImage(with: url, completed: nil) from my json file to load the images. I'm close, but stuck on this part :\
Hope this makes sense, thanks for your help!
I'm using import SDWebImage for the fetchJSON()