Coding at Home: May 26th, Back to Assemble Your Camera

Come back with us to assembling your camera! Live at 1pm, Irish time on Twitch!

Recap: Build an App in Swift Playgrounds

We may be done with live coding our aquarium app, but hopefully you’re not! There’s so much more you could do with the tools and techniques we’ve used over the last few days.

We added an array to track the number of ducks someone might add to our aquarium. Then we added a function to a button to line the ducks up as if someone threw bread in the aquarium for them.

Not bad for a week’s worth of work! Well, if you add all the time you’ve spent already, learning about Swift, you’ve definitely spent more than a week!

Now, you may not have gotten this far. We covered a LOT of topics and wrote a lot of code. Go back over the whole Build an App Aquarium series and catch up on parts you feel you might have missed.

If you didn’t quite get the rough contact testing we did, go back to that video and give it a re-watch. That might be a key for your app or game.

This has been a lot of material to digest. What we’ll see is that sometimes it makes sense to go back over previous code you’ve written to really understand it.

Today’s Session

The plan for today’s session is to go back to the Assemble Your Camera playground.

We were nearly done with building out our camera, so we’re going to finish it off over the next few days.

We’ll use the App class to organize our code, and maybe this will give us some ideas about how we can better organize our app or game from the App at Home playground.

In fact, when we review the code on the MyCamera class that notifies inputs of an image having been taken, you might start thinking about ways you could use that technique in your own game. Maybe for a fish that communicates with other fish in its school. Or in a squadron of enemy ships, when one gets near the player’s ship, notifies the others of their location.

You’ll be able to look back over a lot of the code you’ve written and begin to apply new things you’re learning. Or maybe just new things you’re appreciating, now that you’ve had a bit of experience coding.

See you at 1pm!

Coding at Home: May 25th, Build an App Aquarium Part 5 of 3

We’re back at 1pm today, Irish time! Come build an app with us, exercise those creative muscles!

The story so far

We’ve been building out an app using the techniques we learned in Everyone Can Code Puzzles and the Lights, Camera, Code sessions. We have a Space onto which we can place different components, like Buttons, ImageViews, Labels.

Using techniques from the Assemble Your Camera playground, we’ve wired up the buttons to perform actions in our own code!

You might have an amazing app right now that looks like a super cool digital aquarium. Or you might have a space-based game with a few tweaks to the images you use.

More tools today

Today we’re going to explore some more tools we can use for our game or app.

Arrays are great tools for keeping track of things in our apps. We’ll look at using them to remember all the fish we add to our app aquarium.

I’ll also show you a really handy feature of Swift Playgrounds for refactoring your code.

See you at 1pm!

Coding at Home: May 22nd, Lookback Session #3

Sign up to get onto today’s lookback session, where we’ll cover the beginner playground, Code Machine!

Even if you’ve never done any programming before, so long as you have an iPad, we’ll get you set up to start your journey!

Yesterday’s Session

In yesterday’s session (part 4 of 3, yes, you read that right), we built more of our app/game aquarium.

We added a stepCounter for our fish, we added a button to add more fish, we laughed, we cried. And we definitely debugged a bit, too.

We worked on some of those esoteric skills needed in development: tracking down an issue when it looks like you have everything set up right.

New Landing Pages

We added a new landing page where you can access each one of our playlists from the past 53 videos. Hopefully this will make it easier to follow along with a given series we’ve been running.

We’ve organized them into one mega-playlist, the first one, kids.code().

The next is just the videos for the Everyone Can Code Puzzles material.

Then we have the Lights, Camera, Code playlist, which covers both the Lights, Camera, Code and the Assemble Your Camera playgrounds if you’re a little more advanced.

Lastly, we have the current playlist-in-progress: Build an Aquarium App.

So if you’ve fallen behind on the live sessions, feel free to catch up on one of the playlists.

Or… you can do that and come join us for our lookback session today at 1pm! Just sign up on the registration page!

Coding at Home: May 21st: Keep Building your App in Swift Playgrounds

We’ll be back again today with our app project in Swift Playgrounds, live at 1pm, Irish time on Twitch!

Yesterday’s session

Yesterday we added a rough hit detection function to tell when we were near another component, which might come in handy if we’re building an app or game where we want to be careful for other objects on the screen.

To do this we looked deep inside the guts of the Swift playground to find the HelperFunctions.swift file, where there was a handy distance(from:) function defined on the Point type. This function did a lot of the hard work of figuring out how far away two points on our grid were from each other.

From there we could figure out if it would look like the images for those components were touching or not.

We also even added a Game Over label for our game, when we did detect a collision.

Today

Today we’ll be going back to the app just one more time, I promise!

We’ll add a counter for our game/app now. This will let us keep track of our score, whatever we determine that to be.

And the last thing we’ll do is add a label to show that score to the player.

See you at 1pm!

Coding at Home: May 20th, Build an Aquarium App, Part 3

Join us today for probably our last session on building an app in Swift Playgrounds! Live on Twitch at 1pm, Irish time!

There’s so much more we could do; we could spend weeks refining our work so far into a game or a full-fledged app.

Today’s Session

Today we’re going to focus on rudimentary hit testing… to see when one component we’ve added to the space is near another one.

We’ll use some functions defined for us inside the guts of the playground, including a method on the Point type called distance(from:). This will return us a Double, which we can use to figure out if two components appear to be touching or not.

This would be an important thing to calculate if we were to make a game where collisions with other objects might be a bad thing (or a good thing, depending on your game).

We’ll also harken back to chapter 10 of Everyone Can Code Puzzles and do some refactoring… we’ve been slapping code together without too much foresight thus far. Now we’ll revise our code a bit and make things that little bit neater.

A major goal of refactoring is often to make life easier for our future self: when we sit back down to go further with our app or game we’ll thank ourself for packaging code into a function or storing something in a variable so we could use it later.

See you at 1pm!

Coding at Home: Build an Aquarium App, Continued

Today’s session promises to be a ton of fun, so tune in with us and let’s build an app in Swift Playgrounds!

Recap

Yesterday we started to explore building out an app inside Swift Playgrounds.

Our new App at Home playground!

We added buttons on the screen, a fish, set a background image, and even hooked up the button to move the fish.

The thing I loved about yesterday’s session was the nearly endless possibilities it opens up for us. We can build anything from here:

  • a calming aquarium
  • a really stressful aquarium in which sharks chase your fish
  • a fishing game
  • a space game with enemy ships you need to avoid
  • an app for an aquarium to place by its tanks
  • you name it!

The students in the house here wound up building two of those options and discussing at least two more, coding for another three hours after the live coding session was over!

Today’s session

So today we’re going back to that well. We’ll refine our own aquarium example a bit, add some more controls, implement some logic in our functions.

The goal will be to spark some ideas of your own for your own app. What are you going to do?

The state of our playground app so far...

Drop us a note on Twitter, or send us an email with directions you’d like to see, and we’ll talk about it on air.

We’ll go back to the Assemble Your Camera playground, for sure, we haven’t forgotten about that, but this side exploration, using some of those techniques and building blocks from the camera playgrounds will hopefully provide some inspiration.

Coding can be an incredibly creative outlet, let’s get a little creative today and build an app!

Coding at Home: May 18th, Build an App Aquarium

Come check us out today live for a session in which we build our own aquarium app!

Last Week

Last week we did a ton of work on assembling our camera and got it to a stage where we’re able to take pictures with our custom designed camera.

Now, your favorite part may be the design you added around your camera. Or it might be the zoom slider you can use to zoom in and out with the back camera.

It might be the mask that shapes the way your images are taken. Or that you wrote your very own class that encapsulated all this code.

Whichever piece of building the camera it is, they’re all massive steps forward in your programming journey!

We’ll be finishing off this playground this week with one last playground page, and then we’ll be moving on to other challenges!

Today: a little detour

We also talked a lot about the Swift Student Challenge last week, in which you build your own interactive playground and submit it to Apple for a chance to win some cool WWDC20 gear.

The challenge is closed, but it doesn’t mean we can’t start getting ready for next year!

Using the stuff we’ve learned in Assemble Your Camera, we’re going to make an aquarium from scratch in today’s session!

We’ll start with the new App at Home playground from our own playground feed and work from there.

It’s based on the Camera Create Starting Point playground from Apple, so we’ll be able to use a lot of the coding concepts we learned about with Assemble Your Camera, like the Button class, and the Space class and all the methods on it so we can place other components on the screen.

Lookback Sessions

By the way, we also had a great lookback session on Friday.

If you’re new to coding or maybe aren’t sure this thing is right for you, these sessions are the perfect introduction. They’re mostly painless, easy, personalized introductions to the language of computers. So just like you might learn French or German for impressing that girl/boy/parent/employer years down the line, I would think of this the same way.

Except the person you might be impressing is yourself, when you approach a problem and realize, “oh, hey, I can take advantage of these devices to do this for me, with just a little bit of code…”

We tailor each session to the people on the call, and it’s always more fun programming with a buddy, so bring a friend along!

We’ll see you today at 1pm, Irish time, for some more live coding fun!

Coding at Home: May 15th, Lookback Session #2

We’re live on a Zoom call today for our second beginner session, so make sure you register with us to get the details! The sessions are still free, just a little more personalized.

We really hope you’ll join us, I swear to you I’m not paying the folks on the session last week to say that they’ve had a ton of fun and are eager for more this week.

Yesterday’s Session & the Swift Student Challenge

We did some stuff yesterday that would get you a long way towards a submission for the Swift Student Challenge.

If you want to re-watch that session, it’s available here:

And we’ve published a new playground with the camera stuff stripped away a little bit that you can use to build out your own idea for an app.

You can get it from https://thecodehub.ie/playgrounds/ if you haven’t already added our playground feed, but if you’ve been taking our course it’s likely already in your More Playgrounds section.

Just tap the GET button and you’ll be able to create to your heart’s content.

We’ll also go over building an app with this playground on Monday and replicating the aquarium I built for yesterday’s session.

So sign up for the Hello, Byte Lookback sessions, designed for beginning coders, complete novices, where we go through this introductory playground at a very manageable pace, and we’ll see you today!

Otherwise, we’ll see you on Monday at 1pm, Irish time!

Coding at Home: May 14th, Assemble Your Camera App

Join us today on Twitch at 1pm, Irish time (or Facebook live or YouTube Live)!

We’ve added a few more locations for you to watch the live stream for your convenience… so if you’re into Twitch or prefer Facebook or YouTube, you can watch along with us from the comfort of your usual haunt. And if you’re not able to catch the live sessions, we now have the kids.code() landing page, which features all the videos from our Coding at Home sessions and a new, separate Lights, Camera, Code playlist landing page, that features only the sessions in which we cover the Lights, Camera, Code and Assemble Your Camera playgrounds… so a little more advanced material.

Whichever way you’re approaching the material, we have a way to get you sorted!

Today’s Session

Today’s the big step! We will start using an App class today. We’ve been teasing all along that we’re effectively building apps, but now you can really see what it might take to build an app. If you have any notion of completing an app in Swift Playgrounds for the WWDC20 Swift Student Challenge, this would certainly be a great approach to take!

This could be YOU!

We’ve been so focused on our own MyCamera class, and now we’re going to put it all together, just like we did in previous playgrounds with SwiftyCamera.

We’ll spend the session setting up our App class. For the curious, we’ll dig into the guts of our playground a bit, for fun and games.

Come along with us for this one, it should be a ton of fun!

Coding at Home: May 13th, Adding the Front/Back Button

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

Lookback Sessions Sign Up

We’re continuing our Lookback Sessions on Fridays. For the month of May we’re covering the Hello, Byte playground, which is a beginner playground that will introduce you to Swift, the language, and coding in general.

Register so we can send you the Zoom details and we’ll see you on the playground!

Today

We ran through a lot of styling yesterday. We looked at ways to lay out your view and some tricks that I use to help orient myself when I’m laying things out. Many times your best bet will be to sketch it out and then use trial and error to see where your elements are.

Today we’re going to focus on the front back button. We’ve already connected our shutter button to the trigger property of our cameraView, so now we’re going to make it so we can swap out the front and back camera feed to our cameraView.

You’ve done an incredible job coming this far! We’ve built a pretty amazing, nearly fully functional camera in just a few short days, this is a massive feat for anybody!

WWDC2020 Student Challenge

This is the sort of work that Apple is looking for for their Swift Student Challenge at WWDC2020 and would form an excellent base for your submission.

We’re happy to help your figure out your idea (we can’t implement it for you but we can give you inspiration and advice or point you in the right direction), so please drop us a note if you’re planning on giving it a shot!

Just drop us a line at [email protected] and operators will be standing by!

See you at 1pm today, Irish time!