Ran
1
I’m watching this lecture.(https://www.youtube.com/watch?v=YH2ouLMMN9I&list=PLMRqhzcHGw1ZkH8RuznGMS0NZs0jWQQ5a&index=28)
My current situation is when I select a card in the simulator, two cards disappear even if the results are not the same. But I couldn’t find a reason.
I’ll leave my Github address. (https://github.com/gwonRan/swift-CardGame/tree/main/MatchApp)
Hi @Ran,
Welcome to the code crew community.
The issue was the second statement in the function checkForMatch
let cardOne = cardsArray[firstFlippedCardIndex!.row]
let cardTwo = cardsArray[firstFlippedCardIndex!.row]
cardTwo should be referencing the secondFlippedCardIndex
let cardOne = cardsArray[firstFlippedCardIndex!.row]
let cardTwo = cardsArray[secondFlippedCardIndex.row]
Don’t forget to go back to the 18:00 minute mark in the video and add the delay to the flipDown() method in CardCollectionViewCell.
Ran
3
oh It was my fault. thank you Chris!