Match Game Issue

Hello

Am facing an issue with Match Game related to card flipping. Tried debugging and googling but not able to resolve. Appreciate any help!

Issue: Card taps are not being recognised and hence below ‘didSelectItemAt’ method is not triggered. Using UIViewHierarchy, i can see that the cards are properly populated as intended.


func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

    let cell = collectionView.cellForItem(at: indexPath) as! CardCollectionViewCell
   
    cell.flip()
}

Below is my Storyboard