We will create a basic prototype of game known as concentration. Where players (usually young children) are tasked with matching every card to its identical complement in as few flips as possible.
Learning objectives for this week are as follows:
- Modifying basic attributes in Xcode
- Accessing documentation through Xcode
- “Option click” is your friend
- Wiring event handlers
- Creating Swift functions
- External vs internal parameter name
Don’t worry about a achieving total functionality. We will revisit this project next week and consider more elegant techniques using Model-View-Controller (MVC).
- Clone the repository for this application
- Create, and switch to a new Git branch using Git
- Change the background color
- Add buttons to the story board
- Change the background color of the buttons
- Change the text of the button to an emoji
- Hint: Edit -> Emoji & Symbols
- Wire event handlers to these buttons. These event handlers are responsible for “flipping” the card when pressed.
- Hint: “control drag”
- Create a label to store the number of times a card has been flipped.
- Consider how we could design functionality for “matching” cards together.
- Consider how we could design the functionality for the whole card game using multiple classes, as opposed to having everything in the ViewController.
The full course materials are available courtesy https://itunes.apple.com/us/course/developing-ios-11-apps-with-swift/id1309275316