Swift WatchKit Tutorial – Part 5: Guessing Game – Episode 3

This is the 5th tutorial on WatchKit App Programming with Swift. Furthermore, this is the third episode on how to program a guessing game with WatchKit.
Today, we will continue with our guessing game and we will add the following elements and mechanisms to it

a) We will add a counter that will make sure that our player can only guess 3 times in order to win the game. And if he / she counted wrong more than 3 times, the player loses the game.
b) Moreover, we will create a label indicating the amount of clicks left to the user. By doing this, we keep the user informed about how many guesses he is away from losing the game.
c) We will change the string of the hurry up label from “Hurry up!” to “You won,” in case the player guessed the correct city where the world’s tallest church is located.

Attila Alexander Teglas has written 58 articles

Attila is a freelance software architect, project manager, consultant, and instructor with more than eight years of experience in the software industry. He developed and managed projects for elite universities, medium-sized companies, multi-national corporations, and the European Union.

He has been developing mobile applications, primarily iOS and Android, for more than five years.

Furthermore, he conducted more than 150+ architecture reviews and audits of mobile apps, scrutinizing and detecting issues & defects for the improvement of these projects.

Regularly, he lectures iOS and Android development to computer science students. Attila rejoices teaching the possibilities and pitfalls of iOS and Android development, giving students the skillset to develop their own high quality apps.

While not writing apps, Attila improves his Chinese and Russian language skills and he travels the world with his beautiful wife.