O'Reilly logo

Swift 2 By Example by Giordano Scalzo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Building a Guess the Number App

As mentioned in the previous chapter, learning a language is just half of the difficulty in building an app; the other half is the framework. This means that learning a language is not enough. In this chapter, we'll implement a simple Guess the Number app, just to become familiar with Xcode and part of the Cocoa Touch framework.

The app is…

Our first complete Swift program is a Guess the Number app, a classic educational game for children where the player must guess a number generated randomly.

For each guess, the game tells the player whether the guess is greater or lower than the generated number (also called the secret number).

It is worth to remember that the goal here is not to build an App Store ready ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required