Coding at Home: May 6th, Classes and Cameras

Join us today for some more live coding at 1pm, Irish time!

Recap

We started our designs for a camera, both from a visual point of view and from a coding point of view.

Yesterday we began looking at the class for our own Camera, which we saved in a file called MyCamera.swift. The class is our template for organizing our code for a camera type that will let us (or others) write code like this and have an instance of our own design for a camera:
let camera = MyCamera()

You might remember that we covered types way oh way back in April… This will be great practice, and if you don’t remember, don’t worry! We’ll go through creating our class, designing it, and using it all over again.

WWDC

Yesterday, our buddy Tim announced the dates for the annual WWDC, or Worldwide Developer Conference for Apple. One of the highlights of the show has always been the student-focused component. This year, they’re looking for your Swift Playgrounds, which is right up your alley, given you’ve been doing this class!

If you want help or advice on what you might submit, given all we’ve covered, feel free to drop us a line on the discussion board or at [email protected].

https://developer.apple.com/wwdc20/swift-student-challenge/

Today’s Session

Today we’re going to talk a bit more about classes, because there were some new wrinkles in the code we saw yesterday.

For one, we’ll talk a little about inheritance.

In this diagram, our Animal class is our base class. It has two subclasses: Dog and Cat. The superclass for the Dog class is Animal.

But we’ll go through all of that today, and create a few classes of our own along the way.

See you at 1pm!

Leave a Reply

Your email address will not be published. Required fields are marked *