Youtube App won't load image or title thumbnails

@BonesOnFire

Found the problem.

In setCell() in VideoTableViewCell you had:

func setCell(_ v:Video) {
        
        
    //Ensure that we have a video
    guard self.video != nil else {
        return
    }
        
    self.video = v
        
    //Set the title label
    self.titleLabel.text = video?.title
    .
    .
    .
    .

and what was happening is that the test on self.video was always going to be nil because video was not being set. The following line of code self.video = v needed to be before it. So your code should have been like this:

func setCell(_ v:Video) {
        
    self.video = v
                
    //Ensure that we have a video
    guard self.video != nil else {
        return
    }
        
    //Set the title label
    self.titleLabel.text = video?.title
    .
    .
    .
    .

So with that correction it works spot on.

:+1:

1 Like