The Match Game Error

I got some error, dont know how to fix it… please some one help me

Hi @Ibo_T

Welcome to the community.

The error is indicating that the variable frontImageView is nil. Check the rest of your CardCollectionViewCell code and make sure that the frontImageView IBOutlet at the top is in fact connected to your storyboard.

Thanks Chris, I compare to Chric code all of them its a same… Tried and reconnected frontImageView to storyboard, but still no luck… dont know where is the problem

@Ibo_T

Can you compress the entire project into a zip file and share that via either Dropbox or Google Drive.

To compress the project, locate the project folder in Finder and then right click on the top level folder and select Compress ProjectName. Post that zip file to either Dropbox or Google Drive and then create a share link and post that link in a reply to this thread.

If you choose to use Google Drive then when you create the Share link, ensure that the “General Access” option is set to “Anyone with the Link” rather than “Restricted”.

https://drive.google.com/file/d/19RhUUyQQudQeB-fDIWTai5dCfpcAihLQ/view?usp=sharing

Could you please check it, where I did wrong… Thank you

@Ibo_T

Hi Ibragim,

I have not found where the error is yet. It’s really strange but I’m still working on it.

@Ibo_T

Hi Ibragim,

I’ve got it to work, but since I don’t know where you are up to in the Lessons, I’m not sure if the code I have added is necessarily helping you grasp what is going on.

Can you tell me what lesson you are up to and if you have tried downloading the completed project from the Resources section of the Course so that you can compare your code to that of Chris Ching as at the Lesson you are up to. I can’t remember the sequence of the Lessons since I followed the course a number of years ago.

These are the two functions in CardCollectionViewCell that needed changes to make it work. Note that in both cases transition options have been added.

   func flipUp(speed:TimeInterval = 0.3) {

        //Flip up animation
        UIView.transition(from: backImageView, to: frontImageView, duration: speed, options: [.transitionFlipFromLeft, .showHideTransitionViews])

        //Set the status of the card
        card?.isFlipped = true
    }

    func flipDown(speed:TimeInterval = 0.3) {
        //Flip down animation
        UIView.transition(from: frontImageView, to: backImageView, duration: speed, options: [.showHideTransitionViews, .transitionFlipFromLeft])

        //Set the status of the card
        card?.isFlipped = false
    }

Thank you, appreciated :slightly_smiling_face: