Adding an Xcode Project to the Repository

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Now let’s add Playground to our repository. In Xcode, select File -> New -> Playground.

Screenshot of Xcode Playground template selection screen
Screenshot of Xcode Playground template selection screen

Select iOS and Blank for the Playground and click the Next button.

Screenshot of Xcode Playground save location
Screenshot of Xcode Playground save location

On the next screen, you get to select where the Playground will be saved. You want to save the Playground in the week-1 folder located in your repository. You must get this location correct; otherwise, your Playground may not be added to your repository.

Select the folder for this week’s homework and click Create. Depending on where your homework folder is located, you may get a dialog asking to allow Xcode to write to the folder. Click Allow.

Screenshot of GitHub Desktop Repository info screen after saving the Playground
Screenshot of GitHub Desktop Repository info screen after saving the Playground

Back in GitHub Desktop, you should have noticed that two changes are listed. These are the results of saving the Playground to the repository.

Let’s commit the changes. Provide a summary such as “added Playground to repo” and click the blue button with Commit 2 files to week 1.

Screenshot of GitHub Desktop Repository info screen push changes to origin
Screenshot of GitHub Desktop Repository info screen push changes to origin

After the commit is complete, click the blue Push origin to put our changes on GitHub. We can verify the changes have been pushed by looking at our repo on GitHub.

Screenshot of GitHub with changes pushed
Screenshot of GitHub with changes pushed

Clicking the drop-down labeled Main, we can see our branch. Selecting that branch will take you to the branch, and you will see the homework folder and the playground.

You are now at the point where you can complete the assignment for the week.

These steps are equivalent to staging the playground addition, committing those changes, and pushing the changes to origin.

# adding multiple files
git add .

git commit -m "added playground to repository"

git push

Let’s review what we have done so far.

  • Created a Playground and saved it to our homework folder for the week
  • Committed the changes
  • Pushed our local branch and all of the changes to GitHub

Let’s add a mentor to the repository as a collaborator.

See forum comments
Download course materials from Github
Previous: Creating a Branch for Homework Assignments Next: Adding a Mentor as a Collaborator to the Repository