Skip to main content

Day 21

About 2 minSwiftcrashcoursepaul-hudsonswifthacking-with-swiftxcodeappstore

Day 21 ๊ด€๋ จ


100 Days of Swift - Day 21

Project 2, part three

Project 2, part three

Now that our app is complete, itโ€™s time for a quick recap what you learned, a short test to make sure youโ€™ve understood what was taught, then another set of challenges โ€“ exercises designed to get you writing your own code as quickly as possible.

I do not provide the answers to these challenges. This is intentional: I want you to figure it out by yourself rather than just looking at someone elseโ€™s work.

John Carmack once said, โ€œfocused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better.โ€

So, I hope you will agree that trying things out for yourself, making mistakes, and finding solutions is key to learning.

Today you should work through the wrap up chapter for project 2, complete its review, then work through all three of its challenges.

Wrap up

Wrap up
100 Days of Swift - Day 21 - Wrap up

Wrap up

This was another relatively simple project, but it's given you the chance to go over some concepts in a little more detail, while also squeezing in a few more concepts alongside. Going over things again in a different way is always helpful to learning, so I hope you don't view this game (or any of the games we'll make in this series!) as a waste of time.

Yes, in this project we revisited Interface Builder, Auto Layout, outlets and other things, but at the same time you've learned about @2x and @3x images, asset catalogs, UIButton, CALayer, UIColor, random numbers, actions, UIAlertController, and more. And you have a finished game too!

Review what you learned

Anyone can sit through a tutorial, but it takes actual work to remember what was taught. Itโ€™s my job to make sure you take as much from these tutorials as possible, so Iโ€™ve prepared a short review to help you check your learning.

Click here to review what you learned in project 2.open in new window

Challenge

One of the best ways to learn is to write your own code as often as possible, so here are three ways you should try extending this app to make sure you fully understand whatโ€™s going on:

  1. Try showing the playerโ€™s score in the navigation bar, alongside the flag to guess.
  2. Keep track of how many questions have been asked, and show one final alert controller after they have answered 10. This should show their final score.
  3. When someone chooses the wrong flag, tell them their mistake in your alert message โ€“ something like โ€œWrong! Thatโ€™s the flag of France,โ€ for example.

Once youโ€™re done, tell other people: youโ€™ve completed your first iOS game, youโ€™ve passed the test, and youโ€™ve even extended it with your own code.

You should be proud of what youโ€™ve accomplished โ€“ good job!


์ด์ฐฌํฌ (MarkiiimarK)
Never Stop Learning.