In this project, you will write code for a class that manages the state of a music playback app – a queue, the currently playing song, and a history. It should be cool, so I hope you enjoy :)

Goals

<aside> <img src="/icons/gradebook_blue.svg" alt="/icons/gradebook_blue.svg" width="40px" />

What will you achieve today?

</aside>

  1. Get even more practice with optionals and unwrapping techniques
  2. Get practice working with arrays in Swift
  3. Get many more reps writing Swift code 💪

Getting Started

<aside> <img src="/icons/checkmark_blue.svg" alt="/icons/checkmark_blue.svg" width="40px" /> Watch this YouTube video for a conceptual & project setup introduction.

</aside>

https://youtu.be/E3gyJydDs3c

Disable AI code completion

This purpose of this project is to have you discover, write, and debug Swift code. In my testing, Xcode’s predictive code completion does a decent – but often incorrect – job of writing code for you. To help you learn more effectively and avoid confusing AI-related errors, I recommend that you disable predictive code completion for this project.

<aside> <img src="/icons/checkmark_blue.svg" alt="/icons/checkmark_blue.svg" width="40px" /> Disable Predictive Code Completion in Xcode’s Settings.

  1. Navigate to Xcode / Settings in the menu bar (+,)

  2. Navigate to the Text Editing tab

  3. Navigate to the Editing sub-tab

  4. Disable Predictive code completion, if enabled

    Screenshot 2025-02-21 at 1.10.40 PM.png

</aside>

Getting the code

This project will be formatted much like L03 - Optionals. We will only be writing Swift code, and there will be a suite of unit tests that you can run locally and that will be used to calculate a portion of your grade.

If you’d like, feel free to go back and watch the YouTube video explaining this format from L03.

<aside> <img src="/icons/checkmark_blue.svg" alt="/icons/checkmark_blue.svg" width="40px" /> Follow the instructions below to set up your repository.

</aside>

  1. Click this link to accept the GitHub Classroom assignment

    GitHub Classroom will soon make a repository for you to use for this lab

  2. Click on the repository URL that GitHub Classroom made for you

    You will be taken to the standard GitHub repository page

  3. Copy the repository URL that you’ll use to clone the repository

    You can find the copyable URL by pressing the big green Code button

    Choose HTTPS or SSH, depending on how the method you use to clone repositories

  4. Clone the repository into your comp433 folder

    <aside> <img src="/icons/warning_red.svg" alt="/icons/warning_red.svg" width="40px" />

    Make sure you put it in your comp433 folder and not in another repo.

    </aside>

    To do this via the command line, you can use these commands:

    cd ~/Developer/comp433          # If your folder is elsewhere, use its path
    git clone <your-repository-url>
    

    Or, you can do this from the Xcode launch window by clicking “Clone Git Repository…