My AboutMe Challenge Was a Hit. Then We Hit a Wall.

Forget the first-class anxiety

It’s been almost two weeks since I shared a challenge proposal here in the  Education Community. In this challenge, students present themselves through an app they developed using a template with Swift Playgrounds. You can check it out here: AboutMe App Challenge: Code your vibe, show the class.

Last week, I conducted the first class for my extracurricular course, “iOS Development for Beginners.” Since the students already had some programming knowledge, I didn’t need to cover basic concepts like variables, basic functions, and similar topics. After I gave a glimpse of what they could do with the template, each one customized with their own identity and presented themselves to the class. Happily, the results were great! 

Valentina, a software engineering sophomore, presenting herself to the class.

The aftermath

It seemed like students were secretly trying to outdo each other with the coolest app, which made them even more excited to dive into learning new SwiftUI topics! By providing them with a template and a secure platform for experimentation, rapid iteration was achieved.

But I must say… they faced one big difficulty that even I couldn't predict: closures! By far, it was the most frequently mentioned topic in every reflection they wrote.

I always tried to make things more abstract and use examples to explain tricky programming concepts like closures, but this time, it just didn’t work out.

As one of the students reflected, 

It’s hard to understand the purpose of the closure. I just can't see why it exists and how to use it.

We know that closures are an essential topic in the Swift language. They’re used everywhere and, most of the time, it's the little detail that makes a code "Swifty". 

I’d love to hear your thoughts! What’s the best way you think to explain closures to students who are new to Swift? 

4 replies

November 10, 2025 Language English

Hello!

Closures are a tough concept to wrap your head around when starting to code. I found the information on this site along with the accompanying web video. https://www.hackingwithswift.com/read/0/21/closures I think it is best described as code inside a variable. one of the more common uses of closures are attached to controls like button or toggles. The state of the button or toggles changes and that causes a bit of code to run (the closure). I hope this information helps at least a little.

November 12, 2025 Language English

Hi!

Thanks for your reply! It’s interesting that you mentioned buttons and toggles. As we explored user interface design with more SwiftUI, it became easier for students to understand the main purpose of closures.

December 03, 2025 Language English

Thank you for sharing this resource! I love these tutorials! Lots of learning ahead! :)

December 18, 2025 Language English

Here's an idea:

"Sometimes curly braces { } in Swift are closures. A closure is a chunk of code you can hand to something else to run later - kind of like a mini-function without a name.

You’ll often see closures in things like Button { ... } or commands like sorted { ... }. The code inside the braces runs when that thing decides to run it (for a Button: when it’s tapped).

Note: if { ... } also uses braces, but that’s just a normal code block that runs immediately when the condition is true - it isn’t a closure you pass around. Although I often call anything in curlies closures, that's "technically" not true."

Does that help?

Also - if it's useful - I teach Swift in a course that's framed as "zero to full stack" - students that have never taken a programming class can take this course. It is a university course, but I find that new-to-coding topics in Swift can really be taught from bright middle-schooler all the way through grad student. Students are building the same mental models when thinking about how computer code works & executes, so age really isn't all that important. Although often metaphors & language used in teaching is.

If it's useful to you - I teach my entire course "flipped", which means over 100 lessons are online & I share them with everyone. You can find them at:

https://bit.ly/prof-g-swiftui

I update it pretty regularly since I teach each semester, although I haven't yet had time to re-work all lessons for iOS26. I do have a doc part way through the first chapter that shows anything that may have changed from Xcode 16 to Xcode 26.

Also - you might find this a fun exercise to adapt "Magic 8 Ball". Here's a set of lessons (again, sorry I haven't updated these for iOS 26 yet). They may give you ideas.

https://bit.ly/swiftui-for-beginners

Finally - I have all of the Keynote slides I present when we're in class together. They include challenges & solutions with what the students seem to think are fun examples. You can find them in the open Google Drive at https://gallaugher.com.

Always reach out if I can help. I love helping other educators get up to speed. Hack on!

This post contains content from YouTube.

If you choose to view this content, YouTube may collect and process certain personal data. You can view YouTube’s <a href="https://www.youtube.com/t/privacy" target="_blank">privacy policy here<span class="a11y">(opens in new window)</span>.</a>

This post contains content from YouTube.

You have rejected content from YouTube. If you want to change your consent, press the button below.