Skip to content

AngusReid/lab02-classes-and-objects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Week 2 - Classes and Objects

This file contains a summary of the information in lab02.html. That file contains the lab instructions and should be opened in a browser so you can see all the images.

In this lab we will:

  • Practise using git
  • Implement a class in Swift
  • Write a progam that creates and uses object instances of that class
  • Learn about class properties, methods, initialisation, access control and mutability

During the lab, we're going to be getting you to practise committing small changes. So, before you start, you'll need to:

  1. Create a private lab02-classes-and-objects repo in your GitHub account
  2. Run git remote set-url origin <new repo uri>
  3. Run git remote add upstream [email protected]:oucs-cosc346-s2-2018/lab02-classes-and-objects.git
  4. Run git push -u origin master

This performs the same steps as we did in last weeks lab. This allows you to write the changes to your repo, while still being able to pull any changes from the upstream repo (using git pull upstream master -- there should be no changes at this stage).

When you push you may find that you're asked for a username/password or that there's something wrong with the ssh key. I like to use the ssh option with git (as I can setup ssh keys to manage authentication).

Check if the file ~/.ssh/id_rsa.pub exists, if not, then create a ssh-keypair using ssh-keygen, and accept the defaults (you can set a key passphrase or not -- I've not done that). Once the keypair exists, copy the public key into the clipboard: cat ~/.ssh/id_rsa.pub | pbcopy. Go into your github account settings and find the SSH and GPG key option. Click on New SSH Key in the top right, and paste (command + v) into the Key box (set the title to something you'll remember -- such as "CS Undergrad Lab"). Save the changes and try to push again -- you should be successful this time.

If you get stuck, talk to one of the teaching team and they'll help you with this.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published