Yesterday you learned the basics of closures, but today things get a little trickier. But that’s OK: Benjamin Franklin once said, “energy and persistence conquer all things” – you can do this!

Sometimes closure syntax can be a bit hard on your eyes. If you find it a bit overwhelming – if you’re staring at some code and aren’t 100% sure of what it means – just go back one video and watch it again.

Today you have seven one-minute videos to watch, and you’ll learn about how closures accept parameters and return values. Once you’ve completed each video there’s a short test to help make sure you’ve understood what was taught.

  1. Using closures as parameters when they accept parameterstest
  2. Using closures as parameters when they return valuestest
  3. Shorthand parameter namestest
  4. Closures with multiple parameterstest
  5. Returning closures from functionstest
  6. Capturing valuestest
  7. Closures summarytest

Remember, stay accountable: tell the world that you’ve just learned all about closures in Swift, and discuss them with others who are learning too.

Need help? Tweet me @twostraws!


The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.

Back to 100 Days of Swift

Click here to visit the Hacking with Swift store >>