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!

Coding at Home: May 5th, Design Our Own Camera

Join us live to day at 1pm, Irish time, on Twitch!

Lights, Camera, Code

There’s still a lot to explore and play with in the Lights, Camera, Code playground, including showing off your own layout for your photoboard.

If you have an amazing design, we would love to see it! Feel free to post it to the Photoboard section of the discussions board. Or email it to us to [email protected].

Today’s Session

Today’s session will be another facet of app development: design.

Assemble Your Camera

And I don’t mean just drawing pictures on the screen. We’ll start thinking about how we want our camera to function, what features it will have.

Of course, there is an element of visual design to today’s session. You can use the built-in Notes app, Tayasui Sketches, or I’ll be using Paper by WeTransfer today to do some sketching of my design.

We’ll learn what elements we need to consider for our camera and how they impact how we want our camera to function.

We’ll also learn that (visual) design in not my particular forté! 🙂

We’ll see you at 1pm!

Coding at Home: May 4th, A Camera Recap

Catch us today at 1pm, Irish time!

Last week

Last week we built a camera that could take pictures from the front or back camera. We took the image when the shutter button was pressed and showed it on the screen in an ImageView component. Then we saved that photo to an album we created with code in the Photos app on your iPad.

This is an incredible amount of work. And we got there in a week. If you found it hard or sometimes confusing, we’ll be going through the playground again today to refresh and retry certain things.

We’ve just begun to inch our way down towards the deep end of the pool. Everyone Can Code Puzzles is the gentle entrance to the pool, Lights, Camera, Code (which we did last week) is getting close to that rope between the deep end and the shallow, and this week we’re going to explore just beyond that rope, in the slopey part where we can still find our feet when we get in trouble.

Today’s session

Today we’ll spend most of the session on reviewing what we did last week and some extra touches to our photo board design. And then we’ll download the Assemble Your Camera playground and begin our very first intermediate playground. Fun times ahead!

Lookback Sessions

Because we’re now entering more advanced material, we wanted to give people a chance to still join the live session and not feel completely lost, or feel like they have to watch all the old videos for 18 hours straight (thanks for the idea, Niamh and Aran!).

So this Friday will be our first “lookback session.” We’ll be working through the Hello, Byte Swift Playground, which is aimed at beginners or people who want practice programming with other people online, live. The session will be on Twitch, as per usual, but I recommend registering (it’s free) so we have an idea of how many people are on, and also to interact with you at home a bit more.

But that’s for Friday. We’ll see you today at 1pm!

Coding at Home: May 1st, Decorating Photos

Join us live today at 1pm, Irish time.

Working with Photos

We’ve done an amazing, mind-blowing job so far. We’ve built a camera that takes pictures and shows them in an image view on the screen and we’ve saved the photos to an album in the Photos app on our iPad.

Today we’re going to work more with the photos we’ve taken and add some decorations to our photos. There is some code we could improve, as always, so we’re going to take a look at how we might code a little safer and take advantage of our newfound connection to the Photos app.

In the end, we’ll have a pretty impressive app. You’ve learned a whole new set of techniques and syntax for building apps. You’ve also practiced using stuff we learned back in Learn to Code 1 & 2.

So we’ll see you at 1pm! Make sure you’re looking good for your photos!

Coding at Home: April 30th

Today we’ll be streaming live from 1pm, Irish time!

Today’s Session

We got off to a roaring start with our very own camera app and image view yesterday with the Lights, Camera, Code playground.

We learned about a few new components that have been written especially for this playground: the Space, SwiftyCamera, and ImageView type. Just like our previous work in Everyone Can Code Puzzles, these types have properties and methods we can use to configure them how we like and perform certain functions.

We worked with the grid of the space for laying out our camera and image view components and sizing them, which is a whole new thing for us.

It brings us closer to app development, because laying out the interface people interact with is a large part of our work, and it is often composed of multiple components.

Today we’ll continue that work and add our pictures to a photo album in the Photos the iPad.

We’ll see you at 1pm today!

Coding at Home: A New Frontier! (April 29th)

Well, it’s still the same frontier, mostly. We’ll still be streaming live each weekday at 1pm, including TODAY.

We’ll still have the recordings up after each session on the kids.code() playlist.

Today’s Session

Today we’ll briefly go over the homework assignment from yesterday: design a staircase for the Appending Removed Values page from the Learn to Code 2 playground that fills the entire row and place characters on each step.

These arrays playground pages are a great way to exercise really important skills and give you great practice for working with arrays in Swift.

Photos!

You have spoken (sort of)!

According to our Twitter poll, people most wanted to learn either app development, taking pictures with code, or augmented reality.

So we picked something that combines a bit of app development and taking pictures with code (we’ll do augmented reality next).

The Lights, Camera, Code playground (from Apple) is a great playground to take your coding to the next level. Plus, you’ll get to take advantage of the camera on your iPad!

We’re going to get introduced to some brand new types and get some experience using the camera of our iPads… from code.

A Big Step

This is a big step from our trip through the fundamentals of coding, but you’re more than ready. We’ll just take our time, go slow, and figure it out.

See you at 1pm and make sure you’ve done your makeup for your photo shoot!

Coding at Home: April 28th, You’re Finished!

You’re now a 100% trained-up coder and I can teach you no more!

(Psst, we’re still live today at 1pm, Irish time!)

Oh, wait. There’s loads more to learn about programming, even Swift! You’ve done an amazing job getting this far with us in the Everyone Can Code Puzzles curriculum — this is no amount of coding to sneeze at! But this is only the beginning of a very long Choose-Your-Own-Adventure style journey.

Today’s Session

Today we’re going to have a look at those playground pages I asked you to look through yesterday: appending items to an array, removing them from one array and adding them to another.

Sometimes it will feel like we have two buckets: one full of items, the other empty. When we iterate through the full bucket, we’ll remove the items we used and append them to the other bucket. Like a To Do pile and a Done pile, in a way.

This will come in handy when your code grows into larger apps with a lot more complexity and you need the app’s code to remember and act on more things for you.

We’re also going to have a guest student on today to talk about the Algorithms chapter in Learn to Code 1 and some strategies they used to solve those puzzles.

What’s Next

We’d love it if you filled out our survey, to help gauge the type of experience people have who are watching the videos. You also have the chance to say what you’d like to study next.

Our Twitter poll finished (nearly) dead even with AR, App Development, and Taking Pictures with Code each receiving two votes (so far), so get in your votes, quick!

See you at 1pm!

Coding at Home: April 27th, Arrays Again

Catch us today at 1pm, Irish time!

Today’s Session

We’re back with arrays today. We’ll be working on rearranging items in our arrays, inserting item, removing them. Arrays are such a useful tool for you to use and they have so many handy features, we’ll make sure you see as many ways to use them as possible.

We’ll also explore how to debug issues with getting items out of our arrays and what types of errors we might see.

from Everyone Can Code Puzzles

This is such an important topic and you’ll use them so much, we’ll make sure we spend plenty of time on them!

See you today at 1!

Coding at Home: April 24th, Arrays

Got time for more arrays today at 1pm, Irish time on our live stream? Join us!

Today’s Session

We’re going to practice using arrays. One of the first things we’ll do is iterate over items in an array; just like you would with items on a to do list, or a shopping list.

For this we’ll be using our for loops quite a bit and working within our repeating block.

We’ll also keep other things in our arrays, like characters, gems, and portals.

Arrays are yet another super useful tool in our coding toolbox. They have a ton of interesting functionality and features, and we’ll get to explore some of that today.

So we’ll catch you at 1pm on Twitch or later on the recording!

Coding at Home: April 23rd, Arrays

We’ll be live today at 1pm, Irish time.

while !understandsWhileLoops

We’ve covered while loops the last few days, which are ways to repeat a certain block of code while a condition is true. We learned why this tool is handy, and when you might use it instead of a for loop.

understandsWhileLoops = true

Now we’re ready for the next tool.

Today: Arrays!

In Chapter 10, we talk about arrays.

From Learn to Code 2: Arrays

An array is a list of items. In Swift, the items in the list will all have the same type. In our playgrounds, we might have an array of Characters or Ints (remember, these are whole numbers).

This is a heavily used tool in programming.

If you skipped ahead a little bit in the Rock, Paper, Scissors playground, you may have seen arrays in use and wondered what the square brackets (‘[‘ and ‘]’) were for, or some of the ways loops were used looked a little different than our for i in 1...n or while condition syntax.

We’ll learn all about the syntax of arrays; how to create them, change them, and use them.

See you at 1pm, Irish time!