- Swift 2 By Example
- Giordano Scalzo
- 190字
- 2021-07-16 12:45:45
The app is…
The app we are going to implement is a UIKit implementation of a memory game: a solitaire version. A memory game, also known as concentration, is a card game where the player must match all the cards, which start reversed, turning up two of them in each turn. If the cards match, they are removed from the table. Otherwise, they are turned down again and the score increases. The goal is to clear the table with the lowest score possible.
In our implementation, we are going to use only standard UIKit components and look at another way of creating the interface in Xcode. We'll create all of our UI directly in the code without using Interface Builder.
Let's start prototyping the screens. Despite this being an educational app, we want it to be a pretty and fun app, so we need at least one option to decide the difficulty, selecting the quantity of cards laid on the table.
The following are the screens we'll implement for the app; the first is to select the difficulty—basically, selecting the number of the cards in the deck: