Skip to main content

Wrap up

About 2 minSwiftiOSArticle(s)bloghackingwithswift.comcrashcourseswiftxcodeappstoreios

Wrap up 관련

Hacking with iOS – learn to code iPhone and iPad apps with free Swift tutorials

Learn Swift coding for iOS with these free tutorials – learn Swift, iOS, and Xcode

Wrap up | Hacking with iOS

Wrap up

Yes, it took quite a lot of user interface code to get this project going, but I hope it has shown you that you can make some great games using just the UIKit tools you already know. Building user interfaces programmatically is obviously much less visual than using storyboards, but the flip side is that everything is under your control – there are no connections happening behind the scenes.

Of course, at the same time as making another game, you've made several steps forward in your iOS development journey, this time learning about addTarget(), enumerated(), joined(), replacingOccurrences(), and more.


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.

Review – Project 8: 7 Swifty Words – Hacking with Swift

Interactive tests that help gauge your progress learning Swift

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. Use the techniques you learned in project 2 to draw a thin gray line around the buttons view, to make it stand out from the rest of the UI.
  2. If the user enters an incorrect guess, show an alert telling them they are wrong. You’ll need to extend the submitTapped() method so that if firstIndex(of:) failed to find the guess you show the alert.
  3. Try making the game also deduct points if the player makes an incorrect guess. Think about how you can move to the next level – we can’t use a simple division remainder on the player’s score any more, because they might have lost some points.

이찬희 (MarkiiimarK)
Never Stop Learning.