In this chapter, we’re going to explore two of the most powerful elements of the Swift language: classes and closures. Classes are a neat way to group functions together, along with data, and be able to create integrated objects with “state.” While closures provide us with a flexible way to use functions, without the usual function overhead – that is, defining them thoroughly, naming them, declaring their arguments, etc.
6.1 Define a basic class
Problem
We want to define a barebones class .