Topics
Published on January 11, 2018 by CodeWithChris

Now that you can flip and match cards, when does the match end?

In this lesson, you’ll implement a countdown timer so that the player only has a short amount of time to win.

When the timer counts down and the player hasn’t matched all the cards, s/he will lose the game!

You’ll learn how to show an alert for the win/lose message too!

This video series builds upon (and requires) the skills learned in these two playlists (So please watch these first if you haven’t already!):

How To Make an App for Beginners:

Build Your Swift Skills:

My Courses:
codewithchris.com/beginnercourse/

Twitter:
twitter.com/CodeWithChris

Reddit:
www.reddit.com/r/CodeWithChris

———————————-

This video series uses the latest and greatest from Apple (Xcode 9, Swift 4, iOS 11) and will teach a beginner with no programming experience how to make iPhone apps. I’m creating these videos with the assumption that the student has no prior knowledge and is starting from scratch.

For more tutorials on how to build iPhone apps, make sure you subscribe and visit my site where you’ll find a community of like minded learners! Learning something new is always more fun with other people!

CodeWithChris is dedicated to teaching beginners and non-programmers all about how to make an app. On the site, you’ll find a ton of free resources and tutorials to aid you on your journey to learn iOS development. Many people have successfully picked up Swift 4, Xcode 9 and app building from my course and materials!

Here’s just a sample of the success stories my students have sent in:

68 Beginners Share Their Success Stories

Leave a Reply

15 Comments on "How To Build a Match Game – Lesson 10 (Win Condition)"

Notify of
avatar

Dung Tien Le
Guest
Dung Tien Le
11 days 4 hours ago

Do I assign a reload function in the checkformatch() to start a new game?

CodeWithChris
Guest
CodeWithChris
10 days 21 hours ago

This is a question a lot of student have regarding the reset of the game. Some have found interesting solutions. I invite you to come and check out what the others did on Facebook: www.facebook.com/groups/codewithchriscommunity/

Normandie Essig
Guest
Normandie Essig
1 month 2 days ago

Hi Chris! You're videos are awesome! I can't get my simulator to scroll so that I can see all of the cards…. Do you have any tips on how to fix this?? I've been following along on my own computer and doing all of the same steps, so I am confused by this error.

CodeWithChris
Guest
CodeWithChris
1 month 2 days ago

Hello! Make sure your constraints are correct and also your UI elements are positions properly. When you code, make sure you test and run your app often to catch error or wrong behavior early! Go back a couple of steps and make sure you have everything done right.

cabyambo
Guest
cabyambo
1 month 11 days ago

I get this warning: "Frame for "CardCell" will be different at runtime" Anyone know how to ix this?

CodeWithChris
Guest
CodeWithChris
1 month 7 days ago

This usually means that the constraints will display your UI elements differently than what you manually did on the storyboard.Double check your UI elements and see if the constraints have to be reset or corrected.If you need additional help, join our Facebook group where we talk code and issues with the videos/lessons.www.facebook.com/groups/codewithchriscommunity/

cabyambo
Guest
cabyambo
1 month 10 days ago

Michael Habermas I did. It seems like the warning is referring to the collection view cell

Michael Habermas
Guest
Michael Habermas
1 month 10 days ago

Did you change the label from center to left?

cabyambo
Guest
cabyambo
1 month 11 days ago

My timer still bounces for some reason

Baby Fun
Guest
Baby Fun
2 months 19 days ago

How create a Solitaire game ???

Hevin Jant
Guest
Hevin Jant
5 months 2 days ago

Thank you

Tom Evelin
Guest
Tom Evelin
5 months 9 days ago

Heya Chris! Great tutorials… is episode 11 far off being finished?

Mina Lee
Guest
Mina Lee
5 months 9 days ago

Hi Chris, do you know why my alert message did not pop up at the end?

Mina Lee
Guest
Mina Lee
5 months 9 days ago

I've forgot to call checkGameEnd() method in method timeElapsed() when the milliseconds <= 0

Van
Guest
Van
5 months 11 days ago

A much longer tutorial than any other videos that teach making an app. But the best tutorial to follow and learn sth

wpDiscuz