Module Outline
Use the following resources and work with your mentor to master the objectives for this module. Practice by completing the Mini-Project, Project, and Challenges.
Lesson Video
Preclass Videos
-
iOS Cohort - Andrew Madsen
Introduction to Git
Video Challenges
Stretch Problem
- We want to check the odds that an individual was fishing on certain days of the week.
create three arrays. One with Strings of names, one with the days of the week as Int, and another with Bools as odds. Ex:
twoToOne = [true, false, false]
- Then create a function with NO parameters that RETURNS three values -> name: String, day: Int, goneFishing: Bool.
- In the function Create 3 random number variables that can be anything between 0 and each array's length.
- Use each random number variable to return a random value in each array.
- Create a variable that holds what your function returns.
- Print out the returned values
Repeat the above but instead of creating 3 random number variables, find a way to store 3 random numbers between 0 and each array's length in only 1 variable.
Create a new project. This will be a single-view app with three buttons. One will say Rock, one will say Paper, one will say Scissors. When the user taps on a button, you will randomly determine what the computer plays, and announce to the user whether the user wins, loses, or ties. Find a way to incorporate Tuples into how your store your variables.
- Hint
- Solution
Tuples
♦ Black Diamond
Project
-
Unit 1 Assessment
This assessment is designed to help you practice using what you learned in this Unit. You will have to use UITableViewControllers, different UIKit elements, segues, outlets, actions, and persistence with NSUserDefaults.
Mastery Review
- Tuples stretch problem