Introduction

To obtain the code for this project:

…please fork and clone this repository:

As shown in the screenshot above, be sure that you un-check the option to copy the main branch only. Then, press the green Create fork button.

You’ll know the fork succeeded when you see your own GitHub username in the top-left corner:

To clone the project into Xcode, press the green Code button, and choose Open with Xcode.

After doing that, you will see the following in Xcode:

Be sure to change the drop-down menu from main to the starter-code option instead:

Once the project has been cloned and is open in Xcode, play the game with a partner by running it in the Simulator, or, by previewing the QuizView structure.

Consider

What are some possible beneficial effects of this app?

What audience of users might this app target?

Filtering and searching

With Mr. Gordon, we will work together in class to understand, using cards, what it means to filter and search a list.

Remember, when writing an algorithm (a recipe), we have three programming concepts to work with:

  1. sequence
  2. selection
  3. iteration

Exercises

In class, you have just learned how to filter the list of outcomes in this game.

Fix the buttons

Do you notice anything about the buttons in this game that feels incorrect?

Use boolean variable(s) in the view model, and the .disabled view modifier on the buttons, to control when different buttons are enabled or disabled.

Use tabs

The interface feels a bit crowded with the scrollable list right below the main user interface of the game.

You have previously learned how to share data between screens (views) in an app using the environment.

Use that same approach to put the array of previous results on one view within this app, and the main user interface of the quiz on its own view.

Instead of filtering, what if the user could search the list of outcomes based on text they type in?

Write a function to allow for this. Use the .searchable view modifier on the scrollable list to allow the user to type in a search string.