Cells are not being reused

I am working on the Card Logic Game. And I’m currently on Lesson 27. I have everything set up except when I scroll down my cards, my first row does not flip back. I followed the instructions and implemented the code below. However, it still does not work.

  func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {

        // Configure the state of the cell based on the card properties
        let cardCell = cell as? CardCollectionViewCell

        let card = cardsArray[indexPath.row]
        cardCell?.configureCell(card: card)

    }

Hi @asab,

Not sure where you are on the whole set but have you done all the lessons?
Chris is explaining how to solve this problem - reusing the cells not currently in the view…

Hi @cedric06nice , Im on Lesson 27: Game Logic. According to the view Chris solves this problem by the block of code, I pasted above. For some reason my cells still do not get reused. I have gone through Chris’s code several times. I can’t figure out what I am missing.