Lesson 10 Game Logic: IndexPath

What does the firstFlippedCardIndex variable mean?

Is it when I select it or when to track a cell? and by tracking I mean how? is it when the cell is tapped ?

Is it the same thing as writing :

var dataInArray = [indexPath.row]? but using another name for the variabel? In this case “var firstFlippedCardIndex: IndexPath?”


Since you are matching two cards, the variable firstCardFlipped saves the indexpath of first card in the firstFlippedCardIndex variable why corresponds to the card the user taps, this way it can be compared to the send card tapped at the new indexPath to see if they match.

Hope that helps.